From cb4b26e03f97ff2f1789f7a59efe2973ab1d0eb9 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 6 Nov 2017 19:47:58 +0900 Subject: flexible prompt --- src/console/components/console.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/console/components') diff --git a/src/console/components/console.js b/src/console/components/console.js index 5028e2a..7997f24 100644 --- a/src/console/components/console.js +++ b/src/console/components/console.js @@ -95,13 +95,23 @@ export default class ConsoleComponent { } showCommand(text) { + this.showConsole('command', text); + } + + showFind() { + this.showConsole('find', ''); + } + + showConsole(mode, initial) { let doc = this.wrapper.ownerDocument; let command = doc.querySelector('#vimvixen-console-command'); let input = doc.querySelector('#vimvixen-console-command-input'); + let promptEle = doc.querySelector('.vimvixen-console-command-prompt'); command.style.display = 'block'; - input.value = text; + input.value = initial; input.focus(); + promptEle.className = `vimvixen-console-command-prompt prompt-${mode}`; window.focus(); this.onInput({ target: input }); -- cgit v1.2.3