mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-12-14 07:07:21 +08:00
e3230f8f21
Fixed broken build system in broken webpack version. Also updates module system to standardise on ES6 import/exports, Especially since babel has changed it's 'default' logic for the old module system.
22 lines
624 B
JavaScript
22 lines
624 B
JavaScript
|
|
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; |