]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/popup.js
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / resources / js / components / popup.js
index ec111963f51e65358c51d5d3333bd5d47fb8e55d..6bd8f9c722b7044b9ae9ab5cd73867e8383a5434 100644 (file)
@@ -1,13 +1,13 @@
-import {fadeIn, fadeOut} from "../services/animations";
-import {onSelect} from "../services/dom";
+import {fadeIn, fadeOut} from '../services/animations.ts';
+import {onSelect} from '../services/dom.ts';
+import {Component} from './component';
 
 /**
  * Popup window that will contain other content.
  * This component provides the show/hide functionality
  * with the ability for popup@hide child references to close this.
- * @extends {Component}
  */
-class Popup {
+export class Popup extends Component {
 
     setup() {
         this.container = this.$el;
@@ -26,11 +26,11 @@ class Popup {
 
         this.container.addEventListener('click', event => {
             if (event.target === this.container && lastMouseDownTarget === this.container) {
-                return this.hide();
+                this.hide();
             }
         });
 
-        onSelect(this.hideButtons, e => this.hide());
+        onSelect(this.hideButtons, () => this.hide());
     }
 
     hide(onComplete = null) {
@@ -47,7 +47,7 @@ class Popup {
     show(onComplete = null, onHide = null) {
         fadeIn(this.container, 120, onComplete);
 
-        this.onkeyup = (event) => {
+        this.onkeyup = event => {
             if (event.key === 'Escape') {
                 this.hide();
             }
@@ -57,5 +57,3 @@ class Popup {
     }
 
 }
-
-export default Popup;
\ No newline at end of file