diff options
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/index.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/content/index.js b/src/content/index.js index ad3f740..66b1121 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -5,7 +5,7 @@ import * as messages from '../shared/messages'; import ConsoleFrame from '../console/console-frame'; import Follow from './follow'; -let cmd = null; +let vvConsole = new ConsoleFrame(window); const invokeEvent = (action) => { if (typeof action === 'undefined' || action === null) { @@ -14,14 +14,14 @@ const invokeEvent = (action) => { switch (action[0]) { case actions.CMD_OPEN: - cmd = new ConsoleFrame(window); + vvConsole.showCommand(''); break; case actions.CMD_TABS_OPEN: if (action[1] || false) { // alter url - cmd = new ConsoleFrame(window, 'open ' + window.location.href); + vvConsole.showCommand('open ' + window.location.href); } else { - cmd = new ConsoleFrame(window, 'open '); + vvConsole.showCommand('open '); } break; case actions.SCROLL_LINES: @@ -75,10 +75,7 @@ window.addEventListener("keypress", (e) => { messages.receive(window, (message) => { switch (message.type) { case 'vimvixen.commandline.blur': - if (cmd) { - cmd.remove(); - cmd = null; - } + vvConsole.hide(); break; case 'vimvixen.commandline.enter': browser.runtime.sendMessage({ |