mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-23 06:05:11 +00:00
Escでメディアビューワが閉じれるように (#5494)
* EscやBackspaceでメディアビューワが閉じれるように * Backspaceでは閉じないように
This commit is contained in:
parent
4c6c06c80a
commit
d672bb4643
3 changed files with 17 additions and 3 deletions
|
@ -43,7 +43,7 @@ export default (opts: Opts = {}) => ({
|
||||||
'ctrl+q': this.renoteDirectly,
|
'ctrl+q': this.renoteDirectly,
|
||||||
'up|k|shift+tab': this.focusBefore,
|
'up|k|shift+tab': this.focusBefore,
|
||||||
'down|j|tab': this.focusAfter,
|
'down|j|tab': this.focusAfter,
|
||||||
'esc': this.blur,
|
//'esc': this.blur,
|
||||||
'm|o': () => this.menu(true),
|
'm|o': () => this.menu(true),
|
||||||
's': this.toggleShowContent,
|
's': this.toggleShowContent,
|
||||||
'1': () => this.reactDirectly('like'),
|
'1': () => this.reactDirectly('like'),
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="dkjvrdxtkvqrwmhfickhndpmnncsgacq">
|
<div class="dkjvrdxtkvqrwmhfickhndpmnncsgacq" v-hotkey.global="keymap">
|
||||||
<div class="bg" @click="close"></div>
|
<div class="bg" @click="close"></div>
|
||||||
<img :src="image.url" :alt="image.name" :title="image.name" @click="close"/>
|
<img :src="image.url" :alt="image.name" :title="image.name" @click="close"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,6 +19,13 @@ export default Vue.extend({
|
||||||
easing: 'linear'
|
easing: 'linear'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
keymap(): any {
|
||||||
|
return {
|
||||||
|
'esc': this.close,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
anime({
|
anime({
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="mk-media-video-dialog">
|
<div class="mk-media-video-dialog" v-hotkey.global="keymap">
|
||||||
<div class="bg" @click="close"></div>
|
<div class="bg" @click="close"></div>
|
||||||
<video :src="video.url" :title="video.name" controls autoplay ref="video" @volumechange="volumechange"/>
|
<video :src="video.url" :title="video.name" controls autoplay ref="video" @volumechange="volumechange"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,6 +22,13 @@ export default Vue.extend({
|
||||||
if (this.start) videoTag.currentTime = this.start
|
if (this.start) videoTag.currentTime = this.start
|
||||||
videoTag.volume = this.$store.state.device.mediaVolume;
|
videoTag.volume = this.$store.state.device.mediaVolume;
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
keymap(): any {
|
||||||
|
return {
|
||||||
|
'esc': this.close,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
anime({
|
anime({
|
||||||
|
|
Loading…
Reference in a new issue