diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-15 12:34:26 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-15 17:42:17 +0900 |
commit | ac5354020e5efdf6e284d4b36696b9f94d46bef9 (patch) | |
tree | b515691907c341a053998bec269e54db1a3a8808 /src/content/components/top-content/index.js | |
parent | 4c9d0433a6ac851e72d50d6fb0451baa9d35fd35 (diff) |
support multi-frame following
Diffstat (limited to 'src/content/components/top-content/index.js')
-rw-r--r-- | src/content/components/top-content/index.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/content/components/top-content/index.js b/src/content/components/top-content/index.js new file mode 100644 index 0000000..a2179da --- /dev/null +++ b/src/content/components/top-content/index.js @@ -0,0 +1,32 @@ +import CommonComponent from '../common'; +import FollowController from './follow-controller'; +import * as consoleFrames from '../../console-frames'; +import messages from 'shared/messages'; + +export default class TopContent { + + constructor(win, store) { + this.win = win; + this.children = [ + new CommonComponent(win, store), + new FollowController(win, store), + ]; + + // TODO make component + consoleFrames.initialize(window.document); + } + + update() { + this.children.forEach(c => c.update()); + } + + onMessage(message, sender) { + 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)); + } +} |