From ebcc1f324eadb6a1f801f03b07383af35d4a2ab2 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Wed, 28 Sep 2011 11:48:36 +1300 Subject: [PATCH] BUGFIX: "Parent Page" dropdown isn't hidden in "Edit Page" -> Settings (SSO-15) --- javascript/CMSMain.EditForm.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/javascript/CMSMain.EditForm.js b/javascript/CMSMain.EditForm.js index 85b9305a..2aa16f92 100644 --- a/javascript/CMSMain.EditForm.js +++ b/javascript/CMSMain.EditForm.js @@ -243,5 +243,32 @@ return confirm(message); } }); + + /** + * Class: .cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked + * + * Showing the "Page location" "Parent page" chooser only when the "Sub-page underneath a parent page" + * radio button is selected + */ + $('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({ + + /** + * Function: onclick + * + * Parameters: + * (Event) e + */ + onchange: function(e) { + var parentTreeDropDown = $('.cms-edit-form.CMSPageSettingsController #ParentID'); + + if (e.target.id == 'Form_EditForm_ParentType_root') parentTreeDropDown.slideUp(); + else parentTreeDropDown.slideDown(); + } + }); + + //trigger an initial change event to do the initial hiding of the element, if necessary + if ($('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr('id') == 'Form_EditForm_ParentType_root') { + $('.cms-edit-form.CMSPageSettingsController #ParentID').hide(); //quick hide on first run + } }); }(jQuery)); \ No newline at end of file