aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display-generator.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js/display-generator.js')
-rw-r--r--ext/mixed/js/display-generator.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js
index b48ddadc..0102afbc 100644
--- a/ext/mixed/js/display-generator.js
+++ b/ext/mixed/js/display-generator.js
@@ -22,9 +22,10 @@
*/
class DisplayGenerator {
- constructor({japaneseUtil, mediaLoader}) {
+ constructor({japaneseUtil, mediaLoader, hotkeyHelpController}) {
this._japaneseUtil = japaneseUtil;
this._mediaLoader = mediaLoader;
+ this._hotkeyHelpController = hotkeyHelpController;
this._templates = null;
this._termPitchAccentStaticTemplateIsSetup = false;
}
@@ -32,6 +33,14 @@ class DisplayGenerator {
async prepare() {
const html = await api.getDisplayTemplatesHtml();
this._templates = new HtmlTemplateCollection(html);
+ this.updateHotkeys();
+ }
+
+ updateHotkeys() {
+ const hotkeyHelpController = this._hotkeyHelpController;
+ for (const template of this._templates.getAllTemplates()) {
+ hotkeyHelpController.setupNode(template.content);
+ }
}
preparePitchAccents() {