mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-23 23:29:59 +08:00
Upgraded app to Laravel 5.7
This commit is contained in:
20
resources/js/components/entity-permissions-editor.js
Normal file
20
resources/js/components/entity-permissions-editor.js
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
class EntityPermissionsEditor {
|
||||
|
||||
constructor(elem) {
|
||||
this.permissionsTable = elem.querySelector('[permissions-table]');
|
||||
|
||||
// Handle toggle all event
|
||||
this.restrictedCheckbox = elem.querySelector('[name=restricted]');
|
||||
this.restrictedCheckbox.addEventListener('change', this.updateTableVisibility.bind(this));
|
||||
}
|
||||
|
||||
updateTableVisibility() {
|
||||
this.permissionsTable.style.display =
|
||||
this.restrictedCheckbox.checked
|
||||
? null
|
||||
: 'none';
|
||||
}
|
||||
}
|
||||
|
||||
export default EntityPermissionsEditor;
|
Reference in New Issue
Block a user