diff --git a/packages/mindplot/src/components/Keyboard.ts b/packages/mindplot/src/components/Keyboard.ts index 4a771228..1c53de07 100644 --- a/packages/mindplot/src/components/Keyboard.ts +++ b/packages/mindplot/src/components/Keyboard.ts @@ -16,9 +16,13 @@ * limitations under the License. */ import $ from 'jquery'; +import initHotKeyPluggin from '../../../../libraries/jquery.hotkeys'; + +// Provides dispatcher of keyevents by key... +initHotKeyPluggin($); class Keyboard { - addShortcut(shortcuts: string[] | string, callback, stopPropagation?: true) { + addShortcut(shortcuts: string[] | string, callback: () => void, stopPropagation?: true) { const shortcutsArray = Array.isArray(shortcuts) ? shortcuts : [shortcuts]; shortcutsArray.forEach((shortcut) => { $(document).bind('keydown', shortcut, @@ -27,7 +31,7 @@ class Keyboard { e.stopPropagation(); e.preventDefault(); } - callback(e); + callback(); }); }); } diff --git a/packages/mindplot/src/components/MultilineTextEditor.ts b/packages/mindplot/src/components/MultilineTextEditor.ts index 1c33586d..1d84f41f 100644 --- a/packages/mindplot/src/components/MultilineTextEditor.ts +++ b/packages/mindplot/src/components/MultilineTextEditor.ts @@ -18,13 +18,10 @@ import { $defined } from '@wisemapping/core-js'; import $ from 'jquery'; -import initHotKeyPluggin from '../../../../libraries/jquery.hotkeys'; import Events from './Events'; import ActionDispatcher from './ActionDispatcher'; import Topic from './Topic'; -initHotKeyPluggin($); - class MultilineTextEditor extends Events { private _topic: Topic;