aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-20 13:36:54 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-20 13:36:54 -0500
commit2a95f1420f08b034ae8e12ecffed86aa6f33e53a (patch)
tree62e632c09be4f5c51919e68c01982f040304e104 /ext/mixed/js/display.js
parente14bd75a4f2f25c8fc36ee801d952960987e76ad (diff)
Move optionsUpdate message handler into Yomichan class
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js15
1 files changed, 1 insertions, 14 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index f3b5dd2a..089941a9 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -225,15 +225,6 @@ class Display {
}
}
- onRuntimeMessage({action, params}, sender, callback) {
- const handler = Display._runtimeMessageHandlers.get(action);
- if (typeof handler !== 'function') { return false; }
-
- const result = handler(this, params, sender);
- callback(result);
- return false;
- }
-
getOptionsContext() {
throw new Error('Override me');
}
@@ -244,7 +235,7 @@ class Display {
async initialize(options=null) {
await this.updateOptions(options);
- chrome.runtime.onMessage.addListener(this.onRuntimeMessage.bind(this));
+ yomichan.on('optionsUpdate', () => this.updateOptions(null));
}
async updateOptions(options) {
@@ -878,7 +869,3 @@ Display._onKeyDownHandlers = new Map([
return false;
}]
]);
-
-Display._runtimeMessageHandlers = new Map([
- ['optionsUpdate', (self) => self.updateOptions(null)]
-]);