diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-11-10 01:11:00 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-11-10 01:11:00 +0900 |
| commit | 8512e3046a354ea31e8d9ca40fc2a07b47efc72a (patch) | |
| tree | 10f8d8680be8b237a10a95eb7e1d4d6259e9bd1e /src/web | |
| parent | :art: (diff) | |
| download | misskey-8512e3046a354ea31e8d9ca40fc2a07b47efc72a.tar.gz misskey-8512e3046a354ea31e8d9ca40fc2a07b47efc72a.tar.bz2 misskey-8512e3046a354ea31e8d9ca40fc2a07b47efc72a.zip | |
:v:
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/app/desktop/tags/home-widgets/channel.tag | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/web/app/desktop/tags/home-widgets/channel.tag b/src/web/app/desktop/tags/home-widgets/channel.tag index 70e0a1a714..79b57a1e8a 100644 --- a/src/web/app/desktop/tags/home-widgets/channel.tag +++ b/src/web/app/desktop/tags/home-widgets/channel.tag @@ -105,7 +105,10 @@ display block > p + margin 0 + padding 16px text-align center + color #aaa > div height calc(100% - 38px) @@ -237,15 +240,12 @@ this.form = this.opts.form; this.reply = () => { - this.form.update({ - reply: this.post - }); + this.form.refs.text.value = `>>${ this.post.index } `; }; </script> </mk-channel-post> <mk-channel-form> - <p if={ reply }><b>>>{ reply.index }</b> ({ reply.user.name }): <a onclick={ clearReply }>[x]</a></p> <input ref="text" disabled={ wait } onkeydown={ onkeydown } placeholder="書いて"> <style> :scope @@ -272,14 +272,7 @@ <script> this.mixin('api'); - this.clearReply = () => { - this.update({ - reply: null - }); - }; - this.clear = () => { - this.clearReply(); this.refs.text.value = ''; }; @@ -292,9 +285,18 @@ wait: true }); + let text = this.refs.text.value; + let reply = null; + + if (/^>>([0-9]+) /.test(text)) { + const index = text.match(/^>>([0-9]+) /)[1]; + reply = this.parent.posts.find(p => p.index.toString() == index); + text = text.replace(/^>>([0-9]+) /, ''); + } + this.api('posts/create', { - text: this.refs.text.value, - reply_id: this.reply ? this.reply.id : undefined, + text: text, + reply_id: reply ? reply.id : undefined, channel_id: this.parent.channel.id }).then(data => { this.clear(); |