From 4f157e31334c8d4f43767c91d24f250c553aeff6 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 30 Apr 2011 18:34:52 +1200 Subject: [PATCH] MINOR Fixed CreateToplevelGroups toggling in CMSMain.EditForm.js --- javascript/CMSMain.EditForm.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/javascript/CMSMain.EditForm.js b/javascript/CMSMain.EditForm.js index 06c0c570..89762551 100644 --- a/javascript/CMSMain.EditForm.js +++ b/javascript/CMSMain.EditForm.js @@ -173,21 +173,22 @@ * Toggle display of group dropdown in "access" tab, * based on selection of radiobuttons. */ - $('.cms-edit-form #CanViewType, .cms-edit-form #CanEditType').entwine({ + $('.cms-edit-form #CanViewType, .cms-edit-form #CanEditType, .cms-edit-form #CanCreateTopLevelType').entwine({ // Constructor: onmatch onmatch: function() { // TODO Decouple var dropdown; if(this.attr('id') == 'CanViewType') dropdown = $('#ViewerGroups'); else if(this.attr('id') == 'CanEditType') dropdown = $('#EditorGroups'); + else if(this.attr('id') == 'CanCreateTopLevelType') dropdown = $('#CreateTopLevelGroups'); this.find('.optionset :input').bind('change', function(e) { - dropdown.toggle(e.target.value == 'OnlyTheseUsers'); + dropdown[e.target.value == 'OnlyTheseUsers' ? 'show' : 'hide'](); }); // initial state var currentVal = this.find('input[name=' + this.attr('id') + ']:checked').val(); - dropdown.toggle(currentVal == 'OnlyTheseUsers'); + dropdown[currentVal == 'OnlyTheseUsers' ? 'show' : 'hide'](); this._super(); }