1 import {onSelect} from "../services/dom";
2 import {Component} from "./component";
4 export class OptionalInput extends Component {
6 this.removeButton = this.$refs.remove;
7 this.showButton = this.$refs.show;
8 this.input = this.$refs.input;
13 onSelect(this.removeButton, () => {
14 this.input.value = '';
15 this.input.classList.add('hidden');
16 this.removeButton.classList.add('hidden');
17 this.showButton.classList.remove('hidden');
20 onSelect(this.showButton, () => {
21 this.input.classList.remove('hidden');
22 this.removeButton.classList.remove('hidden');
23 this.showButton.classList.add('hidden');