mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-04 15:09:44 +00:00
feat: implement global context-aware keyboard shortcuts and modal keyboard support (Enter/Esc)
This commit is contained in:
parent
696961ea4c
commit
791d78884d
7 changed files with 36 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<modals-modal v-model="show" name="batchQuickMatch" :processing="processing" :width="500" :height="'unset'">
|
||||
<modals-modal v-model="show" name="batchQuickMatch" :processing="processing" :width="500" :height="'unset'" @submit="doBatchQuickMatch">
|
||||
<template #outer>
|
||||
<div class="absolute top-0 left-0 p-5 w-2/3 overflow-hidden">
|
||||
<p class="text-3xl text-white truncate">{{ title }}</p>
|
||||
|
|
|
|||
|
|
@ -108,6 +108,13 @@ export default {
|
|||
if (this.$store.state.innerModalOpen) return
|
||||
if (action === this.$hotkeys.Modal.CLOSE) {
|
||||
this.show = false
|
||||
} else if (action === this.$hotkeys.Modal.SUBMIT) {
|
||||
const activeElement = document.activeElement
|
||||
// Don't submit if we are in a textarea or certain inputs
|
||||
if (activeElement && ['TEXTAREA'].includes(activeElement.tagName)) {
|
||||
return
|
||||
}
|
||||
this.$emit('submit')
|
||||
}
|
||||
},
|
||||
setShow() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<modals-modal ref="modal" v-model="show" name="move-to-library" :width="400" :height="'unset'" :processing="processing">
|
||||
<modals-modal ref="modal" v-model="show" name="move-to-library" :width="400" :height="'unset'" :processing="processing" @submit="moveItems">
|
||||
<template #outer>
|
||||
<div class="absolute top-0 left-0 p-5 w-2/3 overflow-hidden">
|
||||
<p class="text-3xl text-white truncate">{{ $strings.LabelMoveToLibrary }}</p>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<modals-modal ref="modal" v-model="show" name="split-book" :width="600" :height="'unset'" :processing="processing">
|
||||
<modals-modal ref="modal" v-model="show" name="split-book" :width="600" :height="'unset'" :processing="processing" @submit="submit">
|
||||
<template #outer>
|
||||
<div class="absolute top-0 left-0 p-5 w-2/3 overflow-hidden">
|
||||
<p class="text-3xl text-white truncate">{{ $strings.HeaderSplitBook || 'Split Book' }}</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue