aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-26 19:48:53 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-26 19:48:53 -0500
commitd17af2cbabb6d34e2053c016c93a8545fcb9052c (patch)
tree32c7ec81f1a7fcbee977a4dc6e157a8c3262dab7
parent359eabb26eeb7e21fc866a94cbcc4afa788e93fe (diff)
Move event handler definitions
-rw-r--r--ext/bg/js/search.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index 2dd4e758..c692a859 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -54,6 +54,10 @@ class DisplaySearch extends Display {
['AltGraph', []],
['Shift', []]
]);
+
+ this._runtimeMessageHandlers = new Map([
+ ['searchQueryUpdate', ({query}) => { this.onExternalSearchUpdate(query); }]
+ ]);
}
static create() {
@@ -156,10 +160,10 @@ class DisplaySearch extends Display {
}
onRuntimeMessage({action, params}, sender, callback) {
- const handler = DisplaySearch._runtimeMessageHandlers.get(action);
+ const handler = this._runtimeMessageHandlers.get(action);
if (typeof handler !== 'function') { return false; }
- const result = handler(this, params, sender);
+ const result = handler(params, sender);
callback(result);
return false;
}
@@ -360,8 +364,4 @@ class DisplaySearch extends Display {
}
}
-DisplaySearch._runtimeMessageHandlers = new Map([
- ['searchQueryUpdate', (self, {query}) => { self.onExternalSearchUpdate(query); }]
-]);
-
DisplaySearch.instance = DisplaySearch.create();