1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-27 06:01:54 +03:00

Cleaned up old permission JS code

Removed now unused JS entity-permissions compontent.
Updated existing permissions-table compontent to newer format.
Removed now unused translation string.
This commit is contained in:
Dan Brown
2022-10-02 13:57:32 +01:00
parent f19bad8903
commit b8b0afa0df
7 changed files with 26 additions and 57 deletions

View File

@ -1,22 +1,21 @@
class PermissionsTable {
constructor(elem) {
this.container = elem;
setup() {
this.container = this.$el;
// Handle toggle all event
const toggleAll = elem.querySelector('[permissions-table-toggle-all]');
toggleAll.addEventListener('click', this.toggleAllClick.bind(this));
for (const toggleAllElem of (this.$manyRefs.toggleAll || [])) {
toggleAllElem.addEventListener('click', this.toggleAllClick.bind(this));
}
// Handle toggle row event
const toggleRowElems = elem.querySelectorAll('[permissions-table-toggle-all-in-row]');
for (let toggleRowElem of toggleRowElems) {
for (const toggleRowElem of (this.$manyRefs.toggleRow || [])) {
toggleRowElem.addEventListener('click', this.toggleRowClick.bind(this));
}
// Handle toggle column event
const toggleColumnElems = elem.querySelectorAll('[permissions-table-toggle-all-in-column]');
for (let toggleColElem of toggleColumnElems) {
for (const toggleColElem of (this.$manyRefs.toggleColumn || [])) {
toggleColElem.addEventListener('click', this.toggleColumnClick.bind(this));
}
}