mirror of https://github.com/FreeTubeApp/FreeTube
Add Ctrl+F handling to Channel search bar
This commit is contained in:
parent
fa1cd3632e
commit
7337fe1d1b
|
@ -16,6 +16,7 @@ import autolinker from 'autolinker'
|
|||
import {
|
||||
setPublishedTimestampsInvidious,
|
||||
copyToClipboard,
|
||||
ctrlFHandler,
|
||||
extractNumberFromString,
|
||||
formatNumber,
|
||||
showToast
|
||||
|
@ -434,6 +435,7 @@ export default defineComponent({
|
|||
},
|
||||
mounted: function () {
|
||||
this.isLoading = true
|
||||
document.addEventListener('keydown', this.keyboardShortcutHandler)
|
||||
|
||||
if (this.$route.query.url) {
|
||||
this.resolveChannelUrl(this.$route.query.url, this.$route.params.currentTab)
|
||||
|
@ -460,6 +462,9 @@ export default defineComponent({
|
|||
})
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.removeEventListener('keydown', this.keyboardShortcutHandler)
|
||||
},
|
||||
methods: {
|
||||
resolveChannelUrl: async function (url, tab = undefined) {
|
||||
let id
|
||||
|
@ -1950,6 +1955,10 @@ export default defineComponent({
|
|||
})
|
||||
},
|
||||
|
||||
keyboardShortcutHandler: function (event) {
|
||||
ctrlFHandler(event, this.$refs.channelSearchBar)
|
||||
},
|
||||
|
||||
...mapActions([
|
||||
'showOutlines',
|
||||
'updateSubscriptionDetails',
|
||||
|
|
|
@ -206,6 +206,7 @@
|
|||
|
||||
<ft-input
|
||||
v-if="showSearchBar"
|
||||
ref="channelSearchBar"
|
||||
:placeholder="$t('Channel.Search Channel')"
|
||||
:show-clear-text-button="true"
|
||||
class="channelSearch"
|
||||
|
|
Loading…
Reference in New Issue