2018-09-20 10:27:30 -04:00
|
|
|
|
|
|
|
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');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-11-09 16:17:35 -05:00
|
|
|
export default HomepageControl;
|