aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-19 11:36:05 -0400
committerGitHub <noreply@github.com>2020-04-19 11:36:05 -0400
commita6344f635de2464465317b2ceeb6e19aef056848 (patch)
tree3c101c3dbf38dfb26bfb74bb0a38daedc8166811 /ext/mixed/js/display.js
parent3b2663ba0957c65be959ba18dc80e13625e28f02 (diff)
parent99c1a6a6bc0ce55eb2f20703a7f7f69c4bcefd9d (diff)
Merge pull request #446 from toasted-nutbread/dictionary-images
Dictionary images
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index c2284ffe..9587ec3b 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -20,6 +20,7 @@
* DOM
* DisplayContext
* DisplayGenerator
+ * MediaLoader
* WindowScroll
* apiAudioGetUri
* apiBroadcastTab
@@ -62,7 +63,8 @@ class Display {
this.clickScanPrevent = false;
this.setContentToken = null;
- this.displayGenerator = new DisplayGenerator();
+ this.mediaLoader = new MediaLoader();
+ this.displayGenerator = new DisplayGenerator({mediaLoader: this.mediaLoader});
this.windowScroll = new WindowScroll();
this._onKeyDownHandlers = new Map([
@@ -479,6 +481,8 @@ class Display {
const token = {}; // Unique identifier token
this.setContentToken = token;
try {
+ this.mediaLoader.unloadAll();
+
switch (type) {
case 'terms':
await this.setContentTerms(details.definitions, details.context, token);