diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-11 21:07:02 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-11 21:07:02 +0900 |
commit | bf890a6d9d793b581a44ee267616ed589f429bef (patch) | |
tree | 56f0616eed462d825a5e9006f3994fea588df19a /src/console | |
parent | 14d13e2c3abdb090431f59970681cdaf95f0a24a (diff) |
command as action/reducer
Diffstat (limited to 'src/console')
-rw-r--r-- | src/console/console.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/console/console.js b/src/console/console.js index f83f79c..25ab36d 100644 --- a/src/console/console.js +++ b/src/console/console.js @@ -1,6 +1,7 @@ import './console.scss'; import * as backgroundActions from '../actions/background'; import * as consoleActions from '../actions/console'; +import * as commandActions from '../actions/command'; import Completion from './completion'; import consoleReducer from '../reducers/console'; @@ -10,13 +11,6 @@ var completion = null; var completionOrigin = ""; let state = consoleReducer(undefined, {}); -const keydownMessage = (input) => { - return { - type: 'vimvixen.command.enter', - value: input.value - }; -}; - const handleBlur = () => { return browser.runtime.sendMessage(consoleActions.hide()); }; @@ -58,7 +52,7 @@ const handleKeydown = (e) => { case KeyboardEvent.DOM_VK_ESCAPE: return input.blur(); case KeyboardEvent.DOM_VK_RETURN: - return browser.runtime.sendMessage(keydownMessage(e.target)); + return browser.runtime.sendMessage(commandActions.exec(e.target.value)); case KeyboardEvent.DOM_VK_TAB: if (e.shiftKey) { completePrev(); |