branch feature/multi-ui updated (7ab5d230 -> de3f548b)
This is an automated email from the git hooks/post-receive script. New change to branch feature/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from 7ab5d230 Red delete button new 338400f3 Fix bug on adding/deleting choices new de3f548b No more vote type hickup when first loading question The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit de3f548b7809b0586c830babdf26de5b26feab80 Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 16 14:53:21 2019 +0200 No more vote type hickup when first loading question commit 338400f361bafd44ec39a792621c27546047c6f5 Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 16 11:53:24 2019 +0200 Fix bug on adding/deleting choices Summary of changes: pollen-ui-riot-js/src/main/web/js/PollForm.js | 39 +++++++++------------- .../src/main/web/tag/poll/EditVote.tag.html | 1 + 2 files changed, 17 insertions(+), 23 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 338400f361bafd44ec39a792621c27546047c6f5 Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 16 11:53:24 2019 +0200 Fix bug on adding/deleting choices --- pollen-ui-riot-js/src/main/web/js/PollForm.js | 39 +++++++++++---------------- 1 file changed, 16 insertions(+), 23 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 b4745dbc..b8e5d2c7 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollForm.js +++ b/pollen-ui-riot-js/src/main/web/js/PollForm.js @@ -238,32 +238,25 @@ class PollForm { this.model.questions.splice(this.questionEdited, 1); } - addNewChoice(questionId) { - this.model.questions.forEach((question) => { - if (question.id === questionId || question.id === null) { - let choice; - if (question.choices.length > 0) { - let lastChoice = question.choices[question.choices.length - 1]; - if (lastChoice.choiceType.startsWith("DATE")) { - choice = new Choice(lastChoice.choiceType, lastChoice.choiceValue); - } else { - choice = new Choice(lastChoice.choiceType); - } - } else { - choice = new Choice(question.choiceType); - } - choice.choiceOrder = question.choices.length; - question.choices.push(choice); + addNewChoice(questionIndex) { + let question = this.model.questions[questionIndex]; + let choice; + if (question.choices.length > 0) { + let lastChoice = question.choices[question.choices.length - 1]; + if (lastChoice.choiceType.startsWith("DATE")) { + choice = new Choice(lastChoice.choiceType, lastChoice.choiceValue); + } else { + choice = new Choice(lastChoice.choiceType); } - }); + } else { + choice = new Choice(question.choiceType); + } + choice.choiceOrder = question.choices.length; + question.choices.push(choice); } - removeChoice(questionId, index) { - this.model.questions.forEach((question) => { - if (question.id === questionId || question.id === null) { - question.choices.splice(index, 1); - } - }); + removeChoice(questionIndex, index) { + this.model.questions[questionIndex].choices.splice(index, 1); } setStep(step) { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 de3f548b7809b0586c830babdf26de5b26feab80 Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 16 14:53:21 2019 +0200 No more vote type hickup when first loading question --- pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html | 1 + 1 file changed, 1 insertion(+) 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 6dbc0352..36657324 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 @@ -209,6 +209,7 @@ this.pollTypeCheckbox = this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "checkbox"; this.pollTypeSelect = this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "select"; this.pollTypeCoombs = this.question.voteCountingType && this.question.voteCountingType === 7; + this.update(); }); } else { this.pollTypeCheckbox = this.question.voteCountingTypeValue && this.question.voteCountingTypeValue.renderType === "checkbox"; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm