diff --git a/client/dist/js/LeftAndMain_Subsites.js b/client/dist/js/LeftAndMain_Subsites.js index 55de350a..4eb0d7a2 100644 --- a/client/dist/js/LeftAndMain_Subsites.js +++ b/client/dist/js/LeftAndMain_Subsites.js @@ -1 +1 @@ -!function(){"use strict";var t={669:function(t){t.exports=jQuery}},e={};var i,s=function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}(669);(i=s).entwine("ss",(t=>{t("#SubsitesSelect").entwine({onadd(){this.on("change",(function(){window.location.search=t.query.set("SubsiteID",t(this).val())}))}}),t(".cms-container .cms-menu-list li a").entwine({onclick(e){t(".cms-container").loadFragment("admin/subsite_xhr","SubsiteList"),this._super(e)}}),t(".cms-container .SubsiteAdmin .cms-edit-form fieldset.ss-gridfield").entwine({onreload(e){t(".cms-container").loadFragment("admin/subsite_xhr","SubsiteList"),this._super(e)}}),t(".cms-container .tab.subsite-model").entwine({onadd(e){t(".cms-container").loadFragment("admin/subsite_xhr","SubsiteList"),this._super(e)}}),t("#Form_ItemEditForm_AccessAllSubsites").entwine({onmatch(){this.showHideSubsiteList();const e=this;t("#Form_ItemEditForm_AccessAllSubsites input").change((()=>{e.showHideSubsiteList()}))},showHideSubsiteList(){t("#Form_ItemEditForm_Subsites").parent().parent().css("display",t("#Form_ItemEditForm_AccessAllSubsites_1").is(":checked")?"none":"")}}),t(".cms-edit-form").entwine({getChangeTrackerOptions(){const e=void 0===this.entwineData("ChangeTrackerOptions");let i=this._super();return e&&(i=t.extend({},i),i.ignoreFieldSelector+=", input[name=IsSubsite]",this.setChangeTrackerOptions(i)),i}}),t(".cms-edit-form input[name=action_copytosubsite]").entwine({onclick(){this.closest("form").trigger("submit",[this])}})})),i.entwine("ss.preview",(t=>{t(".cms-preview").entwine({onafterIframeAdjustedForPreview(e,i){const s=t(i).find("meta[name=x-subsite-id]").attr("content");s&&(t(i).find("a").each((function(){const e=t(this).attr("href");void 0===e||e.match(/^http:\/\//)||t(this).attr("href",t.path.addSearchParams(e,{SubsiteID:s}))})),t(i).find("form").each((function(){const e=t(this).attr("action");void 0===e||e.match(/^http:\/\//)||t(this).append(``)})))}})}))}(); \ No newline at end of file +!function(){"use strict";var t={669:function(t){t.exports=jQuery}},e={};var i,s=function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}(669);(i=s).entwine("ss",(t=>{t("#SubsitesSelect").entwine({onadd(){this.on("change",(function(){window.location.search=t.query.set("SubsiteID",t(this).val())}))}}),t(".cms-container .SubsiteAdmin .cms-edit-form fieldset.ss-gridfield").entwine({onreload(e){t(".cms-container").loadFragment("admin/subsite_xhr","SubsiteList"),this._super(e)}}),t("#Form_ItemEditForm").entwine({onaftersubmitform(e){this.find('[role="tab"].subsite-model').length>0&&t(".cms-container").loadFragment("admin/subsite_xhr","SubsiteList"),this._super(e)}}),t("#Form_ItemEditForm_AccessAllSubsites").entwine({onmatch(){this.showHideSubsiteList();const e=this;t("#Form_ItemEditForm_AccessAllSubsites input").change((()=>{e.showHideSubsiteList()}))},showHideSubsiteList(){t("#Form_ItemEditForm_Subsites").parent().parent().css("display",t("#Form_ItemEditForm_AccessAllSubsites_1").is(":checked")?"none":"")}}),t(".cms-edit-form").entwine({getChangeTrackerOptions(){const e=void 0===this.entwineData("ChangeTrackerOptions");let i=this._super();return e&&(i=t.extend({},i),i.ignoreFieldSelector+=", input[name=IsSubsite]",this.setChangeTrackerOptions(i)),i}}),t(".cms-edit-form input[name=action_copytosubsite]").entwine({onclick(){this.closest("form").trigger("submit",[this])}})})),i.entwine("ss.preview",(t=>{t(".cms-preview").entwine({onafterIframeAdjustedForPreview(e,i){const s=t(i).find("meta[name=x-subsite-id]").attr("content");s&&(t(i).find("a").each((function(){const e=t(this).attr("href");void 0===e||e.match(/^http:\/\//)||t(this).attr("href",t.path.addSearchParams(e,{SubsiteID:s}))})),t(i).find("form").each((function(){const e=t(this).attr("action");void 0===e||e.match(/^http:\/\//)||t(this).append(``)})))}})}))}(); \ No newline at end of file diff --git a/client/src/js/LeftAndMain_Subsites.js b/client/src/js/LeftAndMain_Subsites.js index 3c8b6098..a3d44624 100644 --- a/client/src/js/LeftAndMain_Subsites.js +++ b/client/src/js/LeftAndMain_Subsites.js @@ -11,16 +11,6 @@ } }); - /* - * Reload subsites dropdown when links are processed - */ - $('.cms-container .cms-menu-list li a').entwine({ - onclick(e) { - $('.cms-container').loadFragment('admin/subsite_xhr', 'SubsiteList'); - this._super(e); - } - }); - /* * Reload subsites dropdown when the admin area reloads (for deleting sites) */ @@ -32,11 +22,15 @@ }); /* - * Reload subsites dropdown when subsites are added or names are modified + * Reload subsites dropdown when subsites are added or modified */ - $('.cms-container .tab.subsite-model').entwine({ - onadd(e) { - $('.cms-container').loadFragment('admin/subsite_xhr', 'SubsiteList'); + $('#Form_ItemEditForm').entwine({ + onaftersubmitform(e) { + // Only load the fragment if this form is the subsite form. + // We can't add a selector to the form itself so check for the tab we added a specific class to. + if (this.find('[role="tab"].subsite-model').length > 0) { + $('.cms-container').loadFragment('admin/subsite_xhr', 'SubsiteList'); + } this._super(e); } });