Have to duplicate previous fix in the Umbraco.Web project as Umbraco.Web.UI gets overwritten with it

This commit is contained in:
sebastiaan
2012-09-02 16:17:12 -02:00
parent 6f64e480df
commit 1118e1e3fd

View File

@@ -3,6 +3,39 @@
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="uc1" TagName="ContentTypeControlNew" Src="../controls/ContentTypeControlNew.ascx" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
jQuery(document).ready(function () {
// Auto selection/de-selection of default template based on allow templates
jQuery("#<%= templateList.ClientID %> input[type='checkbox']").on("change", function () {
var checkbox = jQuery(this);
var ddl = jQuery("#<%= ddlTemplates.ClientID %>");
// If default template is not set, and an allowed template is selected, auto-select the default template
if (checkbox.is(":checked")) {
if (ddl.val() == "0") {
ddl.val(checkbox.val());
}
} else {
// If allowed template has been de-selected, and it's selected as the default, then de-select the default template
if (ddl.val() == checkbox.val()) {
ddl.val("0");
}
}
});
// Auto selection allowed template based on default template
jQuery("#<%= ddlTemplates.ClientID %>").on("change", function () {
var ddl = jQuery(this);
if (ddl.val() != "0") {
jQuery("#<%= templateList.ClientID %> input[type='checkbox'][value='" + ddl.val() + "']").prop("checked", true);
}
});
});
</script>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<uc1:ContentTypeControlNew ID="ContentTypeControlNew1" runat="server"></uc1:ContentTypeControlNew>
<cc1:Pane ID="tmpPane" runat="server">