From cfc65c31313731dfa0d36c2eceaca35e9d50992f Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 18 Feb 2024 08:11:47 -0500 Subject: Refactor DocumentUtil (#706) * Refactor DocumentUtil * Isolate suppression --- ext/js/input/hotkey-handler.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/js/input') diff --git a/ext/js/input/hotkey-handler.js b/ext/js/input/hotkey-handler.js index 6d7d3d7a..818c0155 100644 --- a/ext/js/input/hotkey-handler.js +++ b/ext/js/input/hotkey-handler.js @@ -18,7 +18,7 @@ import {EventDispatcher} from '../core/event-dispatcher.js'; import {EventListenerCollection} from '../core/event-listener-collection.js'; -import {DocumentUtil} from '../dom/document-util.js'; +import {getActiveModifiers, isInputElementFocused} from '../dom/document-util.js'; /** * Class which handles hotkey events and actions. @@ -173,7 +173,7 @@ export class HotkeyHandler extends EventDispatcher { _onKeyDown(event) { const hotkeyInfo = this._hotkeys.get(event.code); if (typeof hotkeyInfo !== 'undefined') { - const eventModifiers = DocumentUtil.getActiveModifiers(event); + const eventModifiers = getActiveModifiers(event); if (this._invokeHandlers(eventModifiers, hotkeyInfo, event.key)) { event.preventDefault(); return; @@ -269,7 +269,7 @@ export class HotkeyHandler extends EventDispatcher { _isHotkeyPermitted(modifiers, key) { return !( (modifiers.length === 0 || (modifiers.length === 1 && modifiers[0] === 'shift')) && - DocumentUtil.isInputElementFocused() && + isInputElementFocused() && this._isKeyCharacterInput(key) ); } -- cgit v1.2.3