aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/console.js5
-rw-r--r--src/pages/console.js17
2 files changed, 7 insertions, 15 deletions
diff --git a/src/components/console.js b/src/components/console.js
index a4bdad5..9580dcf 100644
--- a/src/components/console.js
+++ b/src/components/console.js
@@ -14,9 +14,12 @@ export default class ConsoleComponent {
input.addEventListener('blur', this.onBlur.bind(this));
input.addEventListener('keydown', this.onKeyDown.bind(this));
input.addEventListener('keyup', this.onKeyUp.bind(this));
+
+ this.hideCommand();
+ this.hideError();
}
- static onBlur() {
+ onBlur() {
return browser.runtime.sendMessage({
type: messages.CONSOLE_BLURRED,
});
diff --git a/src/pages/console.js b/src/pages/console.js
index feaf725..b90a9cd 100644
--- a/src/pages/console.js
+++ b/src/pages/console.js
@@ -30,21 +30,10 @@ completionStore.subscribe(() => {
}
});
-const update = (state) => {
- consoleComponent.update(state);
-
- completionStore.dispatch(completionActions.setItems(state.completions));
-};
-
browser.runtime.onMessage.addListener((action) => {
if (action.type === messages.STATE_UPDATE) {
- return update(action.state.console);
+ let state = action.state.console;
+ consoleComponent.update(state);
+ completionStore.dispatch(completionActions.setItems(state.completions));
}
});
-
-window.addEventListener('load', () => {
- let error = window.document.querySelector('#vimvixen-console-error');
- let command = window.document.querySelector('#vimvixen-console-command');
- error.style.display = 'none';
- command.style.display = 'none';
-});