aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-18 15:23:49 -0500
committerGitHub <noreply@github.com>2021-01-18 15:23:49 -0500
commitcbc5ab5696a64fe10d5a37d25cc6e87d8d44481f (patch)
tree1b4de6a6176926b1c2251de291264b33de67eb2c /ext/mixed/js/display.js
parent0420a29d77e7e91a87f8f70623e1dff067640fd8 (diff)
Hotkey help controller (#1272)
* Create HotkeyHelpController * Expose getAllTemplates * Update hotkeys on the context page * Update hotkeys on the display pages * Fix display issue where a hotkey used to be defined but no longer is
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index a9d59aff..6af35074 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -24,6 +24,7 @@
* DocumentUtil
* FrameEndpoint
* Frontend
+ * HotkeyHelpController
* MediaLoader
* PopupFactory
* QueryParser
@@ -50,9 +51,11 @@ class Display extends EventDispatcher {
this._eventListeners = new EventListenerCollection();
this._setContentToken = null;
this._mediaLoader = new MediaLoader();
+ this._hotkeyHelpController = new HotkeyHelpController();
this._displayGenerator = new DisplayGenerator({
japaneseUtil,
- mediaLoader: this._mediaLoader
+ mediaLoader: this._mediaLoader,
+ hotkeyHelpController: this._hotkeyHelpController
});
this._messageHandlers = new Map();
this._directMessageHandlers = new Map();
@@ -201,6 +204,7 @@ class Display extends EventDispatcher {
this._browser = browser;
// Prepare
+ await this._hotkeyHelpController.prepare();
await this._displayGenerator.prepare();
this._displayAudio.prepare();
this._queryParser.prepare();
@@ -285,6 +289,9 @@ class Display extends EventDispatcher {
this._updateTheme(options.general.popupTheme);
this.setCustomCss(options.general.customPopupCss);
this._displayAudio.updateOptions(options);
+ this._hotkeyHelpController.setOptions(options);
+ this._displayGenerator.updateHotkeys();
+ this._hotkeyHelpController.setupNode(document.documentElement);
this._queryParser.setOptions({
selectedParser: options.parsing.selectedParser,