error title

This commit is contained in:
Shin'ya Ueoka 2017-09-01 12:50:29 +09:00
parent d51b674467
commit d5007a747c
4 changed files with 51 additions and 23 deletions

View file

@ -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({