diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-10 15:49:51 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-10 16:05:13 +0900 |
commit | 359fdb528821844f3c2fda718b82ce229a64b29f (patch) | |
tree | 7ef0778eaeff3f524938d88bd9dd9e4b2f026b02 /src/console/console-frame.js | |
parent | 3c67cc0a002aded07e88ea25acc881ff080d1ae4 (diff) |
blur as action/reducer
Diffstat (limited to 'src/console/console-frame.js')
-rw-r--r-- | src/console/console-frame.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/console/console-frame.js b/src/console/console-frame.js deleted file mode 100644 index 063026c..0000000 --- a/src/console/console-frame.js +++ /dev/null @@ -1,48 +0,0 @@ -import './console-frame.scss'; -import * as consoleActions from '../actions/console'; - -export default class ConsoleFrame { - constructor(win) { - let element = window.document.createElement('iframe'); - element.src = browser.runtime.getURL('build/console.html'); - element.className = 'vimvixen-console-frame'; - win.document.body.append(element); - - this.element = element; - - this.errorShown = true; - - this.hide(); - } - - showCommand(text) { - this.showFrame(); - this.errorShown = false; - return browser.runtime.sendMessage(consoleActions.showCommand(text)); - } - - showError(text) { - this.showFrame(); - - this.errorShown = true; - this.element.blur(); - - return browser.runtime.sendMessage(consoleActions.showError(text)); - } - - showFrame() { - this.element.style.display = 'block'; - } - - hide() { - this.element.style.display = 'none'; - this.element.blur(); - this.errorShown = false; - - return browser.runtime.sendMessage(consoleActions.hide()); - } - - isErrorShown() { - return this.element.style.display === 'block' && this.errorShown; - } -} |