summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2019-10-21 00:46:14 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-10-21 00:46:14 +0900
commitd672bb46432772cbcb981d4091a0828e2d1b2364 (patch)
treed3956b15e9496e13eedda611944efc426e242982 /src/client
parentImprove emoji-picker (#5515) (diff)
downloadsharkey-d672bb46432772cbcb981d4091a0828e2d1b2364.tar.gz
sharkey-d672bb46432772cbcb981d4091a0828e2d1b2364.tar.bz2
sharkey-d672bb46432772cbcb981d4091a0828e2d1b2364.zip
Escでメディアビューワが閉じれるように (#5494)
* EscやBackspaceでメディアビューワが閉じれるように * Backspaceでは閉じないように
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/common/scripts/note-mixin.ts2
-rw-r--r--src/client/app/common/views/components/image-viewer.vue9
-rw-r--r--src/client/app/desktop/views/components/media-video-dialog.vue9
3 files changed, 17 insertions, 3 deletions
diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts
index 54e90714e7..43fb4fd51e 100644
--- a/src/client/app/common/scripts/note-mixin.ts
+++ b/src/client/app/common/scripts/note-mixin.ts
@@ -43,7 +43,7 @@ export default (opts: Opts = {}) => ({
'ctrl+q': this.renoteDirectly,
'up|k|shift+tab': this.focusBefore,
'down|j|tab': this.focusAfter,
- 'esc': this.blur,
+ //'esc': this.blur,
'm|o': () => this.menu(true),
's': this.toggleShowContent,
'1': () => this.reactDirectly('like'),
diff --git a/src/client/app/common/views/components/image-viewer.vue b/src/client/app/common/views/components/image-viewer.vue
index e668a2f46b..7787942ca8 100644
--- a/src/client/app/common/views/components/image-viewer.vue
+++ b/src/client/app/common/views/components/image-viewer.vue
@@ -1,5 +1,5 @@
<template>
-<div class="dkjvrdxtkvqrwmhfickhndpmnncsgacq">
+<div class="dkjvrdxtkvqrwmhfickhndpmnncsgacq" v-hotkey.global="keymap">
<div class="bg" @click="close"></div>
<img :src="image.url" :alt="image.name" :title="image.name" @click="close"/>
</div>
@@ -19,6 +19,13 @@ export default Vue.extend({
easing: 'linear'
});
},
+ computed: {
+ keymap(): any {
+ return {
+ 'esc': this.close,
+ };
+ }
+ },
methods: {
close() {
anime({
diff --git a/src/client/app/desktop/views/components/media-video-dialog.vue b/src/client/app/desktop/views/components/media-video-dialog.vue
index 3c682ecefb..803350506a 100644
--- a/src/client/app/desktop/views/components/media-video-dialog.vue
+++ b/src/client/app/desktop/views/components/media-video-dialog.vue
@@ -1,5 +1,5 @@
<template>
-<div class="mk-media-video-dialog">
+<div class="mk-media-video-dialog" v-hotkey.global="keymap">
<div class="bg" @click="close"></div>
<video :src="video.url" :title="video.name" controls autoplay ref="video" @volumechange="volumechange"/>
</div>
@@ -22,6 +22,13 @@ export default Vue.extend({
if (this.start) videoTag.currentTime = this.start
videoTag.volume = this.$store.state.device.mediaVolume;
},
+ computed: {
+ keymap(): any {
+ return {
+ 'esc': this.close,
+ };
+ }
+ },
methods: {
close() {
anime({