mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
3ba6e70540
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@114062 467b73ca-7a2a-4603-9d3b-597d59a354a9
20 lines
623 B
JavaScript
20 lines
623 B
JavaScript
/**
|
|
* UI behaviour for the "Access" tab
|
|
*/
|
|
|
|
var siteTreeAccessHandler = function(canField, groupsField) {
|
|
var output = {}
|
|
output['#Form_EditForm_' + canField + ' input'] = {
|
|
initialize: function() {
|
|
if(this.checked) this.click();
|
|
},
|
|
onclick: function() {
|
|
$(groupsField).style.display = (this.value == 'OnlyTheseUsers') ? 'block' : 'none';
|
|
$(groupsField).style.visibility = (this.value == 'OnlyTheseUsers') ? 'visible' : 'hidden';
|
|
}
|
|
}
|
|
return output;
|
|
};
|
|
|
|
Behaviour.register(siteTreeAccessHandler('CanViewType', 'ViewerGroups'));
|
|
Behaviour.register(siteTreeAccessHandler('CanEditType', 'EditorGroups')); |