-/**
- * Entity Selector Popup
- * @extends {Component}
- */
-class EntitySelectorPopup {
+import {Component} from "./component";
+
+export class EntitySelectorPopup extends Component {
setup() {
- this.elem = this.$el;
+ this.container = this.$el;
this.selectButton = this.$refs.select;
-
- window.EntitySelectorPopup = this;
this.selectorEl = this.$refs.selector;
this.callback = null;
show(callback) {
this.callback = callback;
- this.elem.components.popup.show();
+ this.container.components.popup.show();
this.getSelector().focusSearch();
}
hide() {
- this.elem.components.popup.hide();
+ this.container.components.popup.hide();
}
getSelector() {
this.getSelector().reset();
if (this.callback && entity) this.callback(entity);
}
-}
-
-export default EntitySelectorPopup;
\ No newline at end of file
+}
\ No newline at end of file