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 0e4933f514b86d1a952c4047f2517c69b0546714 Author: jcouteau <couteau@codelutin.com> Date: Mon Aug 19 11:06:27 2019 +0200 Multi question poll : - Good navigation between question at creation going back and forth --- pollen-ui-riot-js/src/main/web/js/PollForm.js | 1 - pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/js/PollForm.js b/pollen-ui-riot-js/src/main/web/js/PollForm.js index a0e074ed..06eff007 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollForm.js +++ b/pollen-ui-riot-js/src/main/web/js/PollForm.js @@ -232,7 +232,6 @@ class PollForm { this.setQuestionDefaultSettings(newQuestion); this.questionEdited = this.questionEdited+1; this.model.questions.push(newQuestion); - bus.trigger("questionEditedChanged", this.questionEdited); } addNewChoice(questionId) { diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html index 6adc9c1e..22f3f88e 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestions.tag.html @@ -55,10 +55,16 @@ import "./Choices.tag.html"; //gérer le cas ou on navigue en avant et en arrière if (!this.form.hasVotes) { this.submit(); - this.form.addNewQuestion(); + + if (this.form.questionEdited === this.form.model.questions.length-1) { + this.form.addNewQuestion(); + } else { + this.form.questionEdited++; + } this.question = this.form.model.questions[this.form.questionEdited]; this.refs.title.value = this.question.title; this.refs.description.value = this.question.description; + this.bus.trigger("questionEditedChanged", this.form.questionEdited); this.update(); } }; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.