Improve usability

This commit is contained in:
syuilo 2018-09-18 14:50:13 +09:00
parent dba04cc59c
commit 5184a07cf2
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
4 changed files with 50 additions and 18 deletions

View file

@ -40,12 +40,12 @@
</div>
<footer>
<mk-reactions-viewer :note="p" ref="reactionsViewer"/>
<button class="replyButton" @click="reply" title="%i18n:@reply%">
<button class="replyButton" @click="reply()" title="%i18n:@reply%">
<template v-if="p.reply">%fa:reply-all%</template>
<template v-else>%fa:reply%</template>
<p class="count" v-if="p.repliesCount > 0">{{ p.repliesCount }}</p>
</button>
<button class="renoteButton" @click="renote" title="%i18n:@renote%">
<button class="renoteButton" @click="renote()" title="%i18n:@renote%">
%fa:retweet%<p class="count" v-if="p.renoteCount > 0">{{ p.renoteCount }}</p>
</button>
<button class="reactionButton" :class="{ reacted: p.myReaction != null }" @click="react()" ref="reactButton" title="%i18n:@add-reaction%">
@ -113,9 +113,9 @@ export default Vue.extend({
computed: {
keymap(): any {
return {
'r|left': this.reply,
'r|left': () => this.reply(true),
'a|plus': () => this.react(true),
'q|right': this.renote,
'q|right': () => this.renote(true),
'up|k|shift+tab': this.focusBefore,
'down|j|tab': this.focusAfter,
'1': () => this.reactDirectly('like'),
@ -240,15 +240,17 @@ export default Vue.extend({
}
},
reply() {
reply(viaKeyboard = false) {
(this as any).os.new(MkPostFormWindow, {
reply: this.p
reply: this.p,
animation: !viaKeyboard
}).$once('closed', this.focus);
},
renote() {
renote(viaKeyboard = false) {
(this as any).os.new(MkRenoteFormWindow, {
note: this.p
note: this.p,
animation: !viaKeyboard
}).$once('closed', this.focus);
},