mirror of
				https://github.com/BookStackApp/BookStack.git
				synced 2025-11-04 13:31:45 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			517 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			517 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
 | 
						|
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; |