]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/shortcut-input.js
Attachments: Hid edit/delete controls where lacking permission
[bookstack] / resources / js / components / shortcut-input.js
index fa137898856da8e12dabfb96d998bb8e959e32e6..17e05fc8d140ae7fcd9e22b1310a80459fdfff1c 100644 (file)
@@ -1,13 +1,12 @@
+import {Component} from './component';
+
 /**
  * Keys to ignore when recording shortcuts.
  * @type {string[]}
  */
 const ignoreKeys = ['Control', 'Alt', 'Shift', 'Meta', 'Super', ' ', '+', 'Tab', 'Escape'];
 
-/**
- * @extends {Component}
- */
-class ShortcutInput {
+export class ShortcutInput extends Component {
 
     setup() {
         this.input = this.$el;
@@ -19,16 +18,16 @@ class ShortcutInput {
         this.listenerRecordKey = this.listenerRecordKey.bind(this);
 
         this.input.addEventListener('focus', () => {
-             this.startListeningForInput();
+            this.startListeningForInput();
         });
 
         this.input.addEventListener('blur', () => {
             this.stopListeningForInput();
-        })
+        });
     }
 
     startListeningForInput() {
-        this.input.addEventListener('keydown', this.listenerRecordKey)
+        this.input.addEventListener('keydown', this.listenerRecordKey);
     }
 
     /**
@@ -53,5 +52,3 @@ class ShortcutInput {
     }
 
 }
-
-export default ShortcutInput;
\ No newline at end of file