From ff29e7bb14e2d5f1356134cad5c1e0e60377ea50 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 11 Mar 2017 18:47:21 +0900 Subject: [PATCH] #258 --- src/web/app/common/tags/poll-editor.tag | 15 ++++++---- src/web/app/common/tags/poll.tag | 6 ++-- src/web/app/desktop/tags/post-form-window.tag | 28 +++++++++++-------- src/web/app/desktop/tags/post-form.tag | 28 +++++++++++++------ 4 files changed, 49 insertions(+), 28 deletions(-) diff --git a/src/web/app/common/tags/poll-editor.tag b/src/web/app/common/tags/poll-editor.tag index 9d9b28c763..447486ec8e 100644 --- a/src/web/app/common/tags/poll-editor.tag +++ b/src/web/app/common/tags/poll-editor.tag @@ -90,27 +90,32 @@ this.oninput = (i, e) => { this.choices[i] = e.target.value; - } + }; this.add = () => { this.choices.push(''); this.update(); this.refs.choices.childNodes[this.choices.length - 1].childNodes[0].focus(); - } + }; this.remove = (i) => { this.choices = this.choices.filter((_, _i) => _i != i); this.update(); - } + }; this.destroy = () => { this.opts.ondestroy(); - } + }; this.get = () => { return { choices: this.choices.filter(choice => choice != '') } - } + }; + + this.set = data => { + if (data.choices.length == 0) return; + this.choices = data.choices; + }; diff --git a/src/web/app/common/tags/poll.tag b/src/web/app/common/tags/poll.tag index 6ddaf77595..ce6460bce9 100644 --- a/src/web/app/common/tags/poll.tag +++ b/src/web/app/common/tags/poll.tag @@ -78,9 +78,9 @@ this.toggleResult = () => { this.result = !this.result; - } + }; - this.vote = (id) => { + this.vote = id => { if (this.poll.choices.some(c => c.is_voted)) return; this.api('posts/polls/vote', { post_id: this.post.id, @@ -99,6 +99,6 @@ total: this.total + 1 }); }); - } + }; diff --git a/src/web/app/desktop/tags/post-form-window.tag b/src/web/app/desktop/tags/post-form-window.tag index 4f2ea25389..956e83ac6e 100644 --- a/src/web/app/desktop/tags/post-form-window.tag +++ b/src/web/app/desktop/tags/post-form-window.tag @@ -1,13 +1,19 @@ - 新規投稿返信添付: { parent.files.length }ファイル{ parent.uploadingFiles.length }個のファイルをアップロード中 - - -
- -
-
- -
+ + + 新規投稿 + 返信 + 添付: { parent.files.length }ファイル + { parent.uploadingFiles.length }個のファイルをアップロード中 + + +
+ +
+
+ +
+