This is an automated email from the git hooks/post-receive script. New commit to branch feature/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit a38150bb44aa2606516cdc3eb657a4c89caaccb6 Author: jcouteau <couteau@codelutin.com> Date: Thu Oct 10 17:16:18 2019 +0200 Vote goes to next question --- pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html | 7 ++++++- .../src/main/web/tag/poll/EditVoteOrder.tag.html | 6 +++++- pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html | 14 ++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html index a3a14bda..6dbc0352 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html @@ -388,7 +388,12 @@ this.voting = false; this.voteInEdition = null; this.resetVoteForm(); - this.update(); + if (this.multi) { + this.update(); + this.parent.parent.nextQuestion(); + } else { + this.update(); + } }, (error) => { this.error = error; diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html index c1fe943b..aaaa341b 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html @@ -437,7 +437,11 @@ this.voting = false; this.voteInEdition = null; this.resetVoteForm(); - this.update(); + if (this.multi) { + this.parent.parent.nextQuestion(); + } else { + this.update(); + } }, (error) => { this.error = error; 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 ab8db88e..a02d0057 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 @@ -77,10 +77,16 @@ this.listen("poll", this.onPollChange); this.nextQuestion = () => { - this.questionToVote = this.questionToVote + 1; - this.question = this.poll.questions[this.questionToVote]; - this.bus.trigger("question", this.question); - this.update(); + //TODO gérer le cas dernière question + if (this.questionToVote === this.poll.questions.length - 1) { + //last question, thank you and back to home page + //TODO + } else { + this.questionToVote = this.questionToVote + 1; + this.question = this.poll.questions[this.questionToVote]; + this.bus.trigger("question", this.question); + this.update(); + } }; this.previousQuestion = (e) => { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.