summaryrefslogtreecommitdiff
path: root/ext/fg/js/driver.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-26 22:42:17 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-26 22:42:17 -0700
commit3b0aa88de11427c841f85e860aef91ff5d5c793d (patch)
treea04266ff528dbf9ce19f7ab1ceb9ffe0ee5f6c29 /ext/fg/js/driver.js
parent5de3005d0b9ce8dc30e6e1d8d869c57876ca136f (diff)
cleanup
Diffstat (limited to 'ext/fg/js/driver.js')
-rw-r--r--ext/fg/js/driver.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/fg/js/driver.js b/ext/fg/js/driver.js
index 036dc2d8..2324e6b2 100644
--- a/ext/fg/js/driver.js
+++ b/ext/fg/js/driver.js
@@ -116,8 +116,8 @@ window.driver = new class {
}
onBgMessage({action, params}, sender, callback) {
- const handlers = new class {
- optionsSet(options) {
+ const handlers = {
+ optionsSet: options => {
this.options = options;
if (!this.options.enable) {
this.searchClear();
@@ -125,9 +125,9 @@ window.driver = new class {
}
};
- const method = handlers[action];
- if (typeof(method) === 'function') {
- method.call(this, params);
+ const handler = handlers[action];
+ if (handler) {
+ handler(params);
}
callback();