summaryrefslogtreecommitdiff
path: root/ext/js/display
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-18 08:10:09 -0500
committerGitHub <noreply@github.com>2024-02-18 13:10:09 +0000
commit6cf38229b54efbbc3ae7bc174c3999f9dfa7b1d2 (patch)
tree1d47e64bf80ef2f7fd082dde956d0b214946f189 /ext/js/display
parentc48cd6ff6d8dcced7baf1b27ce3ac2449944f5d7 (diff)
Html templates update (#707)
* Simplify display template loading * Add helper * Rename file * Rename for simplicity * Create templates file * Load * Remove templates * Move permissions templates * Remove "templates" from comments * Fix prepare
Diffstat (limited to 'ext/js/display')
-rw-r--r--ext/js/display/display-generator.js9
-rw-r--r--ext/js/display/display.js2
2 files changed, 4 insertions, 7 deletions
diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js
index 621ea833..65736759 100644
--- a/ext/js/display/display-generator.js
+++ b/ext/js/display/display-generator.js
@@ -39,12 +39,9 @@ export class DisplayGenerator {
this._structuredContentGenerator = new StructuredContentGenerator(this._contentManager, document);
}
- /**
- * @param {import('../comm/api.js').API} api
- */
- async prepare(api) {
- const html = await api.getDisplayTemplatesHtml();
- this._templates.load(html);
+ /** */
+ async prepare() {
+ await this._templates.loadFromFiles(['/templates-display.html']);
this.updateHotkeys();
}
diff --git a/ext/js/display/display.js b/ext/js/display/display.js
index 4cd2d611..588508b5 100644
--- a/ext/js/display/display.js
+++ b/ext/js/display/display.js
@@ -318,7 +318,7 @@ export class Display extends EventDispatcher {
// Prepare
await this._hotkeyHelpController.prepare(this._application.api);
- await this._displayGenerator.prepare(this._application.api);
+ await this._displayGenerator.prepare();
this._queryParser.prepare();
this._history.prepare();
this._optionToggleHotkeyHandler.prepare();