Add shortcut keys to read image and contents warning

This commit is contained in:
AkiraFukushima 2018-08-28 01:17:05 +09:00
parent f3a16235ff
commit bff8c49353
1 changed files with 13 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<div
class="status"
tabIndex="0"
v-shortkey="shortcutEnabled ? {next: ['j'], prev: ['k'], reply: ['r'], boost: ['b'], fav: ['f'], open: ['o'], profile: ['p']} : {}"
v-shortkey="shortcutEnabled ? {next: ['j'], prev: ['k'], reply: ['r'], boost: ['b'], fav: ['f'], open: ['o'], profile: ['p'], image: ['i'], cw: ['x']} : {}"
@shortkey="handleTootControl"
ref="status"
@click="$emit('selectToot')"
@ -394,7 +394,6 @@ export default {
handleTootControl (event) {
switch (event.srcKey) {
case 'next':
console.log(this.shortcutEnabled)
this.$emit('focusNext')
break
case 'prev':
@ -415,6 +414,18 @@ export default {
case 'profile':
this.openUser(this.originalMessage(this.message).account)
break
case 'image':
const images = this.mediaAttachments(this.message)
if (images.length === 0) {
return 0
}
this.openImage(images[0].url, images)
break
case 'cw':
console.log('cw')
this.showContent = !this.showContent
this.showAttachments = !this.showAttachments
break
}
}
}