mirror of
https://github.com/heyman/heynote.git
synced 2024-11-22 07:54:11 +01:00
Don't use conflicting name "select" for language change event
#windows-build
This commit is contained in:
parent
9599fd7d92
commit
c3918c32c5
@ -69,7 +69,7 @@
|
||||
this.$refs.editor.focus()
|
||||
},
|
||||
|
||||
onLanguageSelect(language) {
|
||||
onSelectLanguage(language) {
|
||||
this.showLanguageSelector = false
|
||||
this.$refs.editor.setLanguage(language)
|
||||
},
|
||||
@ -102,7 +102,7 @@
|
||||
<div class="overlay">
|
||||
<LanguageSelector
|
||||
v-if="showLanguageSelector"
|
||||
@select="onLanguageSelect"
|
||||
@selectLanguage="onSelectLanguage"
|
||||
@close="closeLanguageSelector"
|
||||
/>
|
||||
</div>
|
||||
|
@ -41,7 +41,7 @@
|
||||
this.selected = Math.max(this.selected - 1, 0)
|
||||
event.preventDefault()
|
||||
} else if (event.key === "Enter") {
|
||||
this.$emit("select", this.filteredItems[this.selected].token)
|
||||
this.selectItem(this.filteredItems[this.selected].token)
|
||||
event.preventDefault()
|
||||
} else if (event.key === "Escape") {
|
||||
this.$emit("close")
|
||||
@ -49,6 +49,10 @@
|
||||
}
|
||||
},
|
||||
|
||||
selectItem(token) {
|
||||
this.$emit("selectLanguage", token)
|
||||
},
|
||||
|
||||
onInput(event) {
|
||||
// reset selection
|
||||
this.selected = 0
|
||||
@ -78,7 +82,7 @@
|
||||
v-for="item, idx in filteredItems"
|
||||
:key="item.token"
|
||||
:class="idx === selected ? 'selected' : ''"
|
||||
@click="$emit('select', item.token)"
|
||||
@click="selectItem(item.token)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user