aboutsummaryrefslogtreecommitdiff
path: root/src/content/components/top-content
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-19 21:46:51 +0900
committerGitHub <noreply@github.com>2017-10-19 21:46:51 +0900
commitc47a2075bcada9dbb1ab1076a92238d6ce48d347 (patch)
tree27308ee55c2b25a0609c8277909a6aff6b45021f /src/content/components/top-content
parent86431e82f75af48f1a8b98c95257714ff75261fc (diff)
parent71d35005b4b33e90a85dc50964cb96a8b462b748 (diff)
Merge pull request #84 from ueokande/14-lose-console-focus
Fix close focus
Diffstat (limited to 'src/content/components/top-content')
-rw-r--r--src/content/components/top-content/follow-controller.js2
-rw-r--r--src/content/components/top-content/index.js5
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));
}
}