refs #543 Add shortcut to reply, reboot, favourite, open detail, and open profile

This commit is contained in:
AkiraFukushima 2018-08-22 14:32:29 +09:00
parent db4d556ce2
commit cdf5f108cc
1 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,7 @@
<div
class="status"
tabIndex="0"
v-shortkey="{next: ['j'], prev: ['k']}"
v-shortkey="focused ? {next: ['j'], prev: ['k'], reply: ['r'], boost: ['b'], fav: ['f'], open: ['o'], profile: ['p']} : {}"
@shortkey="handleTootControl"
ref="status"
@click="$emit('selectToot')"
@ -392,6 +392,21 @@ export default {
case 'prev':
this.$emit('focusPrev')
break
case 'reply':
this.openReply(this.message)
break
case 'boost':
this.changeReblog(this.message)
break
case 'fav':
this.changeFavourite(this.message)
break
case 'open':
this.openDetail(this.message)
break
case 'profile':
this.openUser(this.originalMessage(this.message).account)
break
}
}
}