mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-26 02:10:19 +08:00
e711290d8b
Had to do some manual fixing of the app.js file due to misplaced comments
29 lines
810 B
JavaScript
29 lines
810 B
JavaScript
import {onSelect} from '../services/dom';
|
|
import {Component} from './component';
|
|
|
|
export class OptionalInput extends Component {
|
|
|
|
setup() {
|
|
this.removeButton = this.$refs.remove;
|
|
this.showButton = this.$refs.show;
|
|
this.input = this.$refs.input;
|
|
this.setupListeners();
|
|
}
|
|
|
|
setupListeners() {
|
|
onSelect(this.removeButton, () => {
|
|
this.input.value = '';
|
|
this.input.classList.add('hidden');
|
|
this.removeButton.classList.add('hidden');
|
|
this.showButton.classList.remove('hidden');
|
|
});
|
|
|
|
onSelect(this.showButton, () => {
|
|
this.input.classList.remove('hidden');
|
|
this.removeButton.classList.remove('hidden');
|
|
this.showButton.classList.add('hidden');
|
|
});
|
|
}
|
|
|
|
}
|