]> BookStack Code Mirror - bookstack/blobdiff - resources/assets/js/components/page-picker.js
Update settings.php
[bookstack] / resources / assets / js / components / page-picker.js
index e697d5f687f4d5f9f97a5d3a7c89be323626a001..577e9f6db7c8a19491c37860a20a6bd6711d3445 100644 (file)
@@ -15,18 +15,20 @@ class PagePicker {
     }
 
     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;
@@ -57,4 +59,4 @@ function toggleElem(elem, show) {
     elem.style.display = show ? display : 'none';
 }
 
-module.exports = PagePicker;
\ No newline at end of file
+export default PagePicker;
\ No newline at end of file