mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-09 20:43:32 +08:00
Updated another set of components
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
import {Component} from "./component";
|
||||
|
||||
class ToggleSwitch {
|
||||
export class ToggleSwitch extends Component {
|
||||
|
||||
constructor(elem) {
|
||||
this.elem = elem;
|
||||
this.input = elem.querySelector('input[type=hidden]');
|
||||
this.checkbox = elem.querySelector('input[type=checkbox]');
|
||||
setup() {
|
||||
this.input = this.$el.querySelector('input[type=hidden]');
|
||||
this.checkbox = this.$el.querySelector('input[type=checkbox]');
|
||||
|
||||
this.checkbox.addEventListener('change', this.stateChange.bind(this));
|
||||
}
|
||||
@ -18,6 +18,4 @@ class ToggleSwitch {
|
||||
this.input.dispatchEvent(changeEvent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ToggleSwitch;
|
||||
}
|
Reference in New Issue
Block a user