mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Formatting file
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
import { Controller } from "stimulus"
|
||||
import TomSelect from "tom-select"
|
||||
import { Controller } from "stimulus";
|
||||
import TomSelect from "tom-select";
|
||||
|
||||
export default class extends Controller {
|
||||
static values = { options: Object }
|
||||
static values = { options: Object };
|
||||
static defaults = {
|
||||
maxItems: 1,
|
||||
maxOptions: null,
|
||||
plugins: ["dropdown_input"],
|
||||
allowEmptyOption: true
|
||||
}
|
||||
allowEmptyOption: true,
|
||||
};
|
||||
|
||||
connect() {
|
||||
this.control = new TomSelect(
|
||||
this.element, { ...this.constructor.defaults, ...this.optionsValue }
|
||||
)
|
||||
this.control = new TomSelect(this.element, {
|
||||
...this.constructor.defaults,
|
||||
...this.optionsValue,
|
||||
});
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
if (this.control) this.control.destroy()
|
||||
if (this.control) this.control.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user