X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/906790226701c99aede853b0ff46bd1998b40aa0..refs/pull/4604/head:/resources/js/components/shortcut-input.js diff --git a/resources/js/components/shortcut-input.js b/resources/js/components/shortcut-input.js index fa1378988..17e05fc8d 100644 --- a/resources/js/components/shortcut-input.js +++ b/resources/js/components/shortcut-input.js @@ -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