summaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2021-12-14 06:22:57 +0100
committerjdlugosz963 <jdlugosz963@gmail.com>2021-12-14 06:22:57 +0100
commit193a6b59425ab45004f4178fc3f5b5bad5b4c660 (patch)
tree334bdb11345889967c45888bb11a129b03a67697 /src/components
parent98bec5686da0c4b7d0279b94968040b01e3218fa (diff)
downloadlom_frontend-193a6b59425ab45004f4178fc3f5b5bad5b4c660.tar.gz
lom_frontend-193a6b59425ab45004f4178fc3f5b5bad5b4c660.zip
make group searcher works
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Searcher.vue19
-rw-r--r--src/components/Sugestion.vue13
2 files changed, 20 insertions, 12 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 }
diff --git a/src/components/Sugestion.vue b/src/components/Sugestion.vue
index cfbcd93..4721ca2 100644
--- a/src/components/Sugestion.vue
+++ b/src/components/Sugestion.vue
@@ -1,14 +1,19 @@
1<template> 1<template>
2 <div class="sugestion"> 2 <div class="sugestion">
3 <span>{{command.name}}</span> 3 <span>{{sugestion[0]}}</span>
4 </div> 4 </div>
5</template> 5</template>
6 6
7<script> 7<script>
8export default { 8export default {
9 props: { 9 props: {
10 command: Function 10 sugestion: Array
11 } 11 },
12
13 created() {
14 this.$nextTick(function () {
15 })
16 }
12 17
13} 18}
14</script> 19</script>
@@ -24,4 +29,4 @@ export default {
24 padding: 5px; 29 padding: 5px;
25 padding-right: 0px; 30 padding-right: 0px;
26 } 31 }
27</style> \ No newline at end of file 32</style>