Improve keyboard shortcut

This commit is contained in:
syuilo 2018-09-18 14:30:50 +09:00
parent ccfd48232a
commit 1ac033ff18
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69

View file

@ -115,9 +115,19 @@ export default Vue.extend({
return { return {
'r|left': this.reply, 'r|left': this.reply,
'a|plus': () => this.react(true), 'a|plus': () => this.react(true),
'n|right': this.renote, 'q|n|right': this.renote,
'up|shift+tab': this.focusBefore, 'up|shift+tab': this.focusBefore,
'down|tab': this.focusAfter, 'down|tab': this.focusAfter,
'1': () => this.reactDirectly('like'),
'2': () => this.reactDirectly('love'),
'3': () => this.reactDirectly('laugh'),
'4': () => this.reactDirectly('hmm'),
'5': () => this.reactDirectly('surprise'),
'6': () => this.reactDirectly('congrats'),
'7': () => this.reactDirectly('angry'),
'8': () => this.reactDirectly('confused'),
'9': () => this.reactDirectly('rip'),
'0': () => this.reactDirectly('pudding'),
}; };
}, },
@ -252,6 +262,13 @@ export default Vue.extend({
}).$once('closed', this.focus); }).$once('closed', this.focus);
}, },
reactDirectly(reaction) {
(this as any).api('notes/reactions/create', {
noteId: this.p.id,
reaction: reaction
});
},
menu() { menu() {
(this as any).os.new(MkNoteMenu, { (this as any).os.new(MkNoteMenu, {
source: this.$refs.menuButton, source: this.$refs.menuButton,