diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-18 22:04:30 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-18 22:04:30 +0900 |
commit | 903c9c78b7965b3a046ad90af36e3cac676da452 (patch) | |
tree | 52cde5919c1940a18ac03b59b90fa42116036308 /src/content/components/top-content | |
parent | 86431e82f75af48f1a8b98c95257714ff75261fc (diff) |
remove message propagation
Diffstat (limited to 'src/content/components/top-content')
-rw-r--r-- | src/content/components/top-content/follow-controller.js | 2 | ||||
-rw-r--r-- | src/content/components/top-content/index.js | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/content/components/top-content/follow-controller.js b/src/content/components/top-content/follow-controller.js index 29f40b3..7570cf8 100644 --- a/src/content/components/top-content/follow-controller.js +++ b/src/content/components/top-content/follow-controller.js @@ -17,6 +17,8 @@ export default class FollowController { this.state = {}; this.keys = []; this.producer = null; + + messages.onMessage(this.onMessage.bind(this)); } onMessage(message, sender) { diff --git a/src/content/components/top-content/index.js b/src/content/components/top-content/index.js index a2179da..c318901 100644 --- a/src/content/components/top-content/index.js +++ b/src/content/components/top-content/index.js @@ -14,19 +14,20 @@ export default class TopContent { // TODO make component consoleFrames.initialize(window.document); + + messages.onMessage(this.onMessage.bind(this)); } update() { this.children.forEach(c => c.update()); } - onMessage(message, sender) { + onMessage(message) { switch (message.type) { case messages.CONSOLE_HIDE_COMMAND: this.win.focus(); consoleFrames.blur(window.document); return Promise.resolve(); } - this.children.forEach(c => c.onMessage(message, sender)); } } |