mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-09 10:22:51 +03:00
Added bookshelves homepage options
- Updated homepage selection UI to be more scalable - Cleaned homepage selection logic in code - Added seed test data for bookshelves - Added bookshelves to permission system
This commit is contained in:
22
resources/assets/js/components/homepage-control.js
Normal file
22
resources/assets/js/components/homepage-control.js
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
class HomepageControl {
|
||||
|
||||
constructor(elem) {
|
||||
this.elem = elem;
|
||||
this.typeControl = elem.querySelector('[name="setting-app-homepage-type"]');
|
||||
this.pagePickerContainer = elem.querySelector('[page-picker-container]');
|
||||
|
||||
this.typeControl.addEventListener('change', this.controlPagePickerVisibility.bind(this));
|
||||
this.controlPagePickerVisibility();
|
||||
}
|
||||
|
||||
controlPagePickerVisibility() {
|
||||
const showPagePicker = this.typeControl.value === 'page';
|
||||
this.pagePickerContainer.style.display = (showPagePicker ? 'block' : 'none');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports = HomepageControl;
|
Reference in New Issue
Block a user