diff options
Diffstat (limited to 'src/components/Searcher.vue')
| -rw-r--r-- | src/components/Searcher.vue | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/components/Searcher.vue b/src/components/Searcher.vue index a1093a2..df6dd9e 100644 --- a/src/components/Searcher.vue +++ b/src/components/Searcher.vue | |||
| @@ -11,9 +11,9 @@ | |||
| 11 | 11 | ||
| 12 | <Sugestion | 12 | <Sugestion |
| 13 | v-for="sugestion in sugestions" | 13 | v-for="sugestion in sugestions" |
| 14 | :key="sugestion[0]" | 14 | :key="sugestion[0]" |
| 15 | :command="sugestion[1]" | 15 | :sugestion="sugestion" |
| 16 | :class="{selected: sugestion[0] === current[0]}" | 16 | :class="{selected: sugestion[0] === current[0]}" |
| 17 | /> | 17 | /> |
| 18 | </div> | 18 | </div> |
| 19 | </template> | 19 | </template> |
| @@ -64,7 +64,6 @@ export default { | |||
| 64 | async execute_current() { | 64 | async execute_current() { |
| 65 | let out = await this.current[1](this) | 65 | let out = await this.current[1](this) |
| 66 | 66 | ||
| 67 | console.log(out) | ||
| 68 | if(out instanceof Object) { | 67 | if(out instanceof Object) { |
| 69 | this.search = '' | 68 | this.search = '' |
| 70 | this.commands = out | 69 | this.commands = out |
| @@ -72,25 +71,29 @@ export default { | |||
| 72 | }, | 71 | }, |
| 73 | 72 | ||
| 74 | hotkeys(e) { | 73 | hotkeys(e) { |
| 75 | e.preventDefault() | ||
| 76 | |||
| 77 | switch(e.code) { | 74 | switch(e.code) { |
| 78 | case 'Escape': | 75 | case 'Escape': |
| 79 | this.close() | 76 | e.preventDefault() |
| 80 | break | 77 | this.close() |
| 78 | break | ||
| 81 | case 'ArrowDown': | 79 | case 'ArrowDown': |
| 80 | e.preventDefault() | ||
| 82 | this.change_current(1) | 81 | this.change_current(1) |
| 83 | break | 82 | break |
| 84 | case 'ArrowUp': | 83 | case 'ArrowUp': |
| 84 | e.preventDefault() | ||
| 85 | this.change_current(-1) | 85 | this.change_current(-1) |
| 86 | break | 86 | break |
| 87 | case 'Tab': | 87 | case 'Tab': |
| 88 | e.preventDefault() | ||
| 88 | this.change_current(1) | 89 | this.change_current(1) |
| 89 | break | 90 | break |
| 90 | case 'Enter': | 91 | case 'Enter': |
| 92 | e.preventDefault() | ||
| 91 | this.execute_current() | 93 | this.execute_current() |
| 92 | break | 94 | break |
| 93 | case 'ShiftLeft': | 95 | case 'ShiftLeft': |
| 96 | e.preventDefault() | ||
| 94 | this.commands = CommandsService | 97 | this.commands = CommandsService |
| 95 | break | 98 | break |
| 96 | } | 99 | } |
