aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-08-14 23:22:37 -0700
committerAlex Yatskov <alex@foosoft.net>2017-08-14 23:22:37 -0700
commit211e5d1155e82ccbbc188dc889600459a62229fb (patch)
treed5d17976dabe7ae8c9af8a3286844fd8e9663524 /ext/fg/js/frontend.js
parent61dde5b3b74030d7b01c195751a54e9dcacdb6bb (diff)
cleanup
Diffstat (limited to 'ext/fg/js/frontend.js')
-rw-r--r--ext/fg/js/frontend.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index cc4d99c8..7d26f946 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -33,14 +33,14 @@ class Frontend {
try {
this.options = await apiOptionsGet();
- window.addEventListener('message', e => this.onFrameMessage(e));
- window.addEventListener('mousedown', e => this.onMouseDown(e));
- window.addEventListener('mousemove', e => this.onMouseMove(e));
- window.addEventListener('mouseover', e => this.onMouseOver(e));
- window.addEventListener('mouseup', e => this.onMouseUp(e));
- window.addEventListener('resize', e => this.onResize(e));
-
- chrome.runtime.onMessage.addListener(({action, params}, sender, callback) => this.onBgMessage(action, params, sender, callback));
+ window.addEventListener('message', this.onFrameMessage.bind(this));
+ window.addEventListener('mousedown', this.onMouseDown.bind(this));
+ window.addEventListener('mousemove', this.onMouseMove.bind(this));
+ window.addEventListener('mouseover', this.onMouseOver.bind(this));
+ window.addEventListener('mouseup', this.onMouseUp.bind(this));
+ window.addEventListener('resize', this.onResize.bind(this));
+
+ chrome.runtime.onMessage.addListener(this.onBgMessage.bind(this));
} catch (e) {
this.onError(e);
}
@@ -124,7 +124,7 @@ class Frontend {
this.searchClear();
}
- onBgMessage(action, params, sender, callback) {
+ onBgMessage({action, params}, sender, callback) {
const handlers = {
optionsSet: options => {
this.options = options;