]> BookStack Code Mirror - bookstack/blob - resources/js/components/entity-permissions-editor.js
Continued implementation of attachment drag+drop
[bookstack] / resources / js / components / entity-permissions-editor.js
1
2 class EntityPermissionsEditor {
3
4   constructor(elem) {
5     this.permissionsTable = elem.querySelector('[permissions-table]');
6
7     // Handle toggle all event
8     this.restrictedCheckbox = elem.querySelector('[name=restricted]');
9     this.restrictedCheckbox.addEventListener('change', this.updateTableVisibility.bind(this));
10   }
11
12   updateTableVisibility() {
13     this.permissionsTable.style.display =
14       this.restrictedCheckbox.checked
15         ? null
16         : 'none';
17   }
18 }
19
20 export default EntityPermissionsEditor;