blur as action/reducer

This commit is contained in:
Shin'ya Ueoka 2017-09-10 15:49:51 +09:00
parent 3c67cc0a00
commit 359fdb5288
4 changed files with 49 additions and 69 deletions

27
src/console/frames.js Normal file
View file

@ -0,0 +1,27 @@
import './console-frame.scss';
import * as consoleActions from '../actions/console';
const initialize = (doc) => {
let iframe = doc.createElement('iframe');
iframe.src = browser.runtime.getURL('build/console.html');
iframe.id = 'vimvixen-console-frame';
iframe.className = 'vimvixen-console-frame';
doc.body.append(iframe);
return iframe;
}
const showCommand = (text) => {
return browser.runtime.sendMessage(consoleActions.showCommand(text));
};
const showError = (text) => {
return browser.runtime.sendMessage(consoleActions.showError(text));
}
const blur = (doc) => {
let iframe = doc.getElementById('vimvixen-console-frame');
iframe.blur();
}
export { initialize, showCommand, showError, blur };