aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/driver.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-04 18:24:57 -0800
committerAlex Yatskov <alex@foosoft.net>2017-03-04 18:24:57 -0800
commit30999c13d32e7f111db16814dc2cbb0f30825861 (patch)
tree3aa24f7045f10237aa744651844d18219d1890e6 /ext/fg/js/driver.js
parentb039d300249087aee18c7e8565ae7447d2cf5b15 (diff)
wip
Diffstat (limited to 'ext/fg/js/driver.js')
-rw-r--r--ext/fg/js/driver.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/fg/js/driver.js b/ext/fg/js/driver.js
index 73ddd84f..2cbe3e08 100644
--- a/ext/fg/js/driver.js
+++ b/ext/fg/js/driver.js
@@ -102,7 +102,13 @@ class Driver {
}
onBgMessage({action, params}, sender, callback) {
- const method = this['api_' + action];
+ const handlers = new class {
+ api_optionsSet(options) {
+ this.options = options;
+ }
+ };
+
+ const method = handlers[`api_${action}`];
if (typeof(method) === 'function') {
method.call(this, params);
}
@@ -205,10 +211,6 @@ class Driver {
errorShow(error);
}
}
-
- api_setOptions(options) {
- this.options = options;
- }
}
window.driver = new Driver();