}
setupListeners() {
- // Select click
- this.selectButton.addEventListener('click', event => {
- window.EntitySelectorPopup.show(entity => {
- this.setValue(entity.id, entity.name);
- });
- });
+ this.selectButton.addEventListener('click', this.showPopup.bind(this));
+ this.display.parentElement.addEventListener('click', this.showPopup.bind(this));
this.resetButton.addEventListener('click', event => {
this.setValue('', '');
});
}
+ showPopup() {
+ window.EntitySelectorPopup.show(entity => {
+ this.setValue(entity.id, entity.name);
+ });
+ }
+
setValue(value, name) {
this.value = value;
this.input.value = value;
elem.style.display = show ? display : 'none';
}
-module.exports = PagePicker;
\ No newline at end of file
+export default PagePicker;
\ No newline at end of file