From 9b253ccb3a122384ba3bfbdbe777b47c7a6b407c Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 12 Oct 2018 14:34:54 +0900 Subject: Refactor --- src/client/app/common/scripts/note-mixin.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/client/app/common/scripts') diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts index ac276dbe68..17182e2757 100644 --- a/src/client/app/common/scripts/note-mixin.ts +++ b/src/client/app/common/scripts/note-mixin.ts @@ -84,6 +84,26 @@ export default (opts: Opts = {}) => ({ }, methods: { + reply(viaKeyboard = false) { + (this as any).apis.post({ + reply: this.appearNote, + animation: !viaKeyboard, + cb: () => { + this.focus(); + } + }); + }, + + renote(viaKeyboard = false) { + (this as any).apis.post({ + renote: this.appearNote, + animation: !viaKeyboard, + cb: () => { + this.focus(); + } + }); + }, + renoteDirectly() { (this as any).api('notes/create', { renoteId: this.appearNote.id -- cgit v1.2.3-freya