mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-23 15:19:58 +08:00
Upgraded app to Laravel 5.7
This commit is contained in:
22
resources/js/components/homepage-control.js
Normal file
22
resources/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');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default HomepageControl;
|
Reference in New Issue
Block a user