mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR Fixed CreateToplevelGroups toggling in CMSMain.EditForm.js
This commit is contained in:
parent
bf8bc1d856
commit
4f157e3133
@ -173,21 +173,22 @@
|
|||||||
* Toggle display of group dropdown in "access" tab,
|
* Toggle display of group dropdown in "access" tab,
|
||||||
* based on selection of radiobuttons.
|
* 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
|
// Constructor: onmatch
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
// TODO Decouple
|
// TODO Decouple
|
||||||
var dropdown;
|
var dropdown;
|
||||||
if(this.attr('id') == 'CanViewType') dropdown = $('#ViewerGroups');
|
if(this.attr('id') == 'CanViewType') dropdown = $('#ViewerGroups');
|
||||||
else if(this.attr('id') == 'CanEditType') dropdown = $('#EditorGroups');
|
else if(this.attr('id') == 'CanEditType') dropdown = $('#EditorGroups');
|
||||||
|
else if(this.attr('id') == 'CanCreateTopLevelType') dropdown = $('#CreateTopLevelGroups');
|
||||||
|
|
||||||
this.find('.optionset :input').bind('change', function(e) {
|
this.find('.optionset :input').bind('change', function(e) {
|
||||||
dropdown.toggle(e.target.value == 'OnlyTheseUsers');
|
dropdown[e.target.value == 'OnlyTheseUsers' ? 'show' : 'hide']();
|
||||||
});
|
});
|
||||||
|
|
||||||
// initial state
|
// initial state
|
||||||
var currentVal = this.find('input[name=' + this.attr('id') + ']:checked').val();
|
var currentVal = this.find('input[name=' + this.attr('id') + ']:checked').val();
|
||||||
dropdown.toggle(currentVal == 'OnlyTheseUsers');
|
dropdown[currentVal == 'OnlyTheseUsers' ? 'show' : 'hide']();
|
||||||
|
|
||||||
this._super();
|
this._super();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user