summaryrefslogtreecommitdiff
path: root/ext/js/display/display.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-03-28 14:04:20 -0400
committerGitHub <noreply@github.com>2021-03-28 14:04:20 -0400
commitb4d6a5d3b4b83c7c3c7f835f775d3207a4b97067 (patch)
tree6039a7c190db6e4b8a4faeb5f8e74b5027bb82c4 /ext/js/display/display.js
parent98994d0b6529e665863bc9f6125eb3e116e0f9d5 (diff)
Toggle option hotkey (#1571)
* Set up toggleOption hotkey action settings * Update styles * Disable spell check and autocomplete * Add OptionToggleHotkeyHandler * Improve auto-close behaviour
Diffstat (limited to 'ext/js/display/display.js')
-rw-r--r--ext/js/display/display.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js
index 3ae55da0..ee2448d6 100644
--- a/ext/js/display/display.js
+++ b/ext/js/display/display.js
@@ -27,6 +27,7 @@
* Frontend
* HotkeyHelpController
* MediaLoader
+ * OptionToggleHotkeyHandler
* PopupFactory
* PopupMenu
* QueryParser
@@ -112,6 +113,7 @@ class Display extends EventDispatcher {
this._ankiNoteNotification = null;
this._ankiNoteNotificationEventListeners = null;
this._queryPostProcessor = null;
+ this._optionToggleHotkeyHandler = new OptionToggleHotkeyHandler(this);
this._hotkeyHandler.registerActions([
['close', () => { this._onHotkeyClose(); }],
@@ -201,6 +203,10 @@ class Display extends EventDispatcher {
return this._parentPopupId;
}
+ get notificationContainer() {
+ return this._footerNotificationContainer;
+ }
+
async prepare() {
// State setup
const {documentElement} = document;
@@ -213,6 +219,7 @@ class Display extends EventDispatcher {
this._displayAudio.prepare();
this._queryParser.prepare();
this._history.prepare();
+ this._optionToggleHotkeyHandler.prepare();
// Event setup
this._history.on('stateChanged', this._onStateChanged.bind(this));