Choices/src/scripts/src/components/wrapped-select.js
2017-10-18 08:43:56 +01:00

45 lines
817 B
JavaScript

import WrappedElement from './wrapped-element';
export default class WrappedSelect extends WrappedElement {
constructor(instance, element, classNames) {
super(instance, element, classNames);
this.parentInstance = instance;
this.element = element;
this.classNames = classNames;
}
conceal() {
super.conceal();
}
reveal() {
super.reveal();
}
enable() {
super.enable();
}
disable() {
super.enable();
}
setOptions(options) {
this.element.innerHTML = '';
this.element.appendChild(options);
}
getPlaceholderOption() {
return this.element.querySelector('option[placeholder]');
}
getOptions() {
return Array.from(this.element.options);
}
getOptionGroups() {
return Array.from(this.element.getElementsByTagName('OPTGROUP'));
}
}