Bring up the keyboard shortcuts when pressing ?

Doesn't really work right now, see https://github.com/iFgR/vue-shortkey/issues/116
This commit is contained in:
kolaente 2021-04-18 19:32:31 +02:00
parent 603345b326
commit c9e0c9b6cf
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 16 additions and 7 deletions

View file

@ -26,7 +26,12 @@
<router-view name="popup"/> <router-view name="popup"/>
</transition> </transition>
<a @click="$store.commit('keyboardShortcutsActive', true)" class="keyboard-shortcuts-button"> <a
class="keyboard-shortcuts-button"
@click="showKeyboardShortcuts()"
@shortkey="showKeyboardShortcuts()"
v-shortkey="['?']"
>
<icon icon="keyboard"/> <icon icon="keyboard"/>
</a> </a>
</div> </div>
@ -36,7 +41,7 @@
<script> <script>
import {mapState} from 'vuex' import {mapState} from 'vuex'
import {CURRENT_LIST, MENU_ACTIVE} from '@/store/mutation-types' import {CURRENT_LIST, KEYBOARD_SHORTCUTS_ACTIVE, MENU_ACTIVE} from '@/store/mutation-types'
import Navigation from '@/components/home/navigation' import Navigation from '@/components/home/navigation'
export default { export default {
@ -115,6 +120,9 @@ export default {
this.$store.commit(MENU_ACTIVE, false) this.$store.commit(MENU_ACTIVE, false)
} }
}, },
showKeyboardShortcuts() {
this.$store.commit(KEYBOARD_SHORTCUTS_ACTIVE, true)
},
}, },
} }
</script> </script>

View file

@ -69,8 +69,9 @@
v-if="privacyPolicyUrl"> v-if="privacyPolicyUrl">
Privacy policy Privacy policy
</a> </a>
<a @click="$store.commit('keyboardShortcutsActive', true)" class="dropdown-item">Keyboard <a @click="$store.commit('keyboardShortcutsActive', true)" class="dropdown-item">
Shortcuts</a> Keyboard Shortcuts
</a>
<a @click="logout()" class="dropdown-item"> <a @click="logout()" class="dropdown-item">
Logout Logout
</a> </a>