This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 52c549cff784f203b08759668c420f8809107ec5 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu Jan 25 13:33:02 2018 +0100 fix #191 --- .../src/main/web/tag/poll/Choice.tag.html | 58 ++++++++++++---------- .../src/main/web/tag/poll/Votes.tag.html | 1 - 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html index 2bd6a368..c4939810 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html @@ -8,12 +8,12 @@ it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. #L% @@ -133,31 +133,37 @@ require("../components/time-picker.tag.html"); this.installBundle(this.session, "choice", locale => { moment.locale(locale); }); - this.originalFile = this.opts.choice.choiceType === "RESOURCE" ? this.opts.choice.choiceValue : null; - this.hasNewFile = false; - this.valueText = this.opts.choice.choiceType === "TEXT" ? this.opts.choice.choiceValue : null; - this.showDescription = this.opts.choice.description; - - if (this.opts.choice.choiceType.startsWith("DATE")) { - this.date = { - date: moment(parseInt(this.opts.choice.choiceValue, 10)) - }; - } else { - this.date = { - date: moment().startOf("day") - }; - } - - if (this.opts.choice.choiceType === "DATETIME") { - this.time = { - time: moment(parseInt(this.opts.choice.choiceValue, 10)) - }; - } else { - this.time = { - time: moment().startOf("day") - }; - } + this.updateChoice = () => { + this.originalFile = this.opts.choice.choiceType === "RESOURCE" ? this.opts.choice.choiceValue : null; + this.hasNewFile = false; + this.valueText = this.opts.choice.choiceType === "TEXT" ? this.opts.choice.choiceValue : null; + this.showDescription = this.opts.choice.description; + + if (this.opts.choice.choiceType.startsWith("DATE")) { + this.date = { + date: moment(parseInt(this.opts.choice.choiceValue, 10)) + }; + } else { + this.date = { + date: moment().startOf("day") + }; + } + + if (this.opts.choice.choiceType === "DATETIME") { + this.time = { + time: moment(parseInt(this.opts.choice.choiceValue, 10)) + }; + } else { + this.time = { + time: moment().startOf("day") + }; + } + }; + + this.updateChoice(); + + this.on("update", this.updateChoice); this.on("mount", this.focus); this.setTextType = () => { diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html index 410991ba..06d0964d 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html @@ -98,7 +98,6 @@ require("../components/Avatar.tag.html"); this.poll.addChoice(this.choiceToAdd).then(() => { this.addingChoice = false; this.choiceToAdd = this.poll.initChoice(this.choiceToAdd); - this.updateShowChoiceContainer(); this.update(); }, errors => { this.addingChoice = false; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.