Converted search filters to not be vue based

This commit is contained in:
Dan Brown
2020-06-27 13:29:00 +01:00
parent 76d02cd472
commit 715dee2d0e
15 changed files with 399 additions and 475 deletions

View File

@ -0,0 +1,28 @@
import {onSelect} from "../services/dom";
class OptionalInput {
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');
});
}
}
export default OptionalInput;