BookStack/resources/js/components/setting-homepage-control.js

19 lines
576 B
JavaScript
Raw Normal View History

import {Component} from './component';
2022-11-15 20:44:57 +08:00
export class SettingHomepageControl extends Component {
2022-11-15 20:44:57 +08:00
setup() {
this.typeControl = this.$refs.typeControl;
this.pagePickerContainer = this.$refs.pagePickerContainer;
this.typeControl.addEventListener('change', this.controlPagePickerVisibility.bind(this));
this.controlPagePickerVisibility();
}
controlPagePickerVisibility() {
const showPagePicker = this.typeControl.value === 'page';
this.pagePickerContainer.style.display = (showPagePicker ? 'block' : 'none');
}
}