aboutsummaryrefslogtreecommitdiff
path: root/src/components/SearchModal.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-06-24 13:37:06 +1000
committerTerry Truong <terry06890@gmail.com>2022-06-24 13:37:06 +1000
commitdb5b4f3069fbe30f6daabffeddf2868d5e8c5240 (patch)
tree8ac47da2eb680508e4bae78d2ef9710566218fdb /src/components/SearchModal.vue
parent62d8ca9bd7ab191152c5fdfebcffcb68e075575e (diff)
Fix search-bar mode-change button not saving setting
Also fix jump-to-search-result not flashing node in some cases.
Diffstat (limited to 'src/components/SearchModal.vue')
-rw-r--r--src/components/SearchModal.vue9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue
index 585b535..dc9da4c 100644
--- a/src/components/SearchModal.vue
+++ b/src/components/SearchModal.vue
@@ -34,13 +34,13 @@ export default defineComponent({
};
},
suggDisplayStrings(): [string, string, string][] {
- let result = [];
- let input = this.$refs.searchInput.value;
+ let result: [string, string, string][] = [];
+ let input = (this.$refs.searchInput as HTMLInputElement).value;
// For each SearchSugg
for (let sugg of this.searchSuggs){
let idx = sugg.name.indexOf(input);
// Split suggestion text into parts before/within/after an input match
- let strings;
+ let strings: [string, string, string];
if (idx != -1){
strings = [sugg.name.substring(0, idx), input, sugg.name.substring(idx + input.length)];
} else {
@@ -72,6 +72,7 @@ export default defineComponent({
},
onSearchModeChg(){
this.uiOpts.jumpToSearchedNode = !this.uiOpts.jumpToSearchedNode;
+ this.$emit('settings-chg', [], ['jumpToSearchedNode']);
},
resolveSearch(tolNodeName: string){
if (tolNodeName == ''){
@@ -190,7 +191,7 @@ export default defineComponent({
(this.$refs.searchInput as HTMLInputElement).focus();
},
components: {SearchIcon, InfoIcon, LogInIcon, },
- emits: ['search', 'close', 'info-click'],
+ emits: ['search', 'close', 'info-click', 'settings-chg', ],
});
</script>