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 79e9af31002850f5713776a2762958c55d13c3ef Author: jcouteau <couteau@codelutin.com> Date: Wed Oct 9 14:32:14 2019 +0200 Fix MaxChoicesNumberConfig save bug --- .../web/tag/poll/EditQuestionsSettings.tag.html | 1 + .../MaxChoicesNumberConfig.tag.html | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestionsSettings.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestionsSettings.tag.html index e82f78f0..eac19b01 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestionsSettings.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditQuestionsSettings.tag.html @@ -177,6 +177,7 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; this.listen("questionEditedChanged", () => { this.question = this.form.model.questions[this.form.questionEdited]; this.updateQuestionType(); + this.update(); }); this.toggleVoteCountingTypeHelp = () => { diff --git a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/MaxChoicesNumberConfig.tag.html b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/MaxChoicesNumberConfig.tag.html index debf6256..78581f86 100644 --- a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/MaxChoicesNumberConfig.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/MaxChoicesNumberConfig.tag.html @@ -26,10 +26,10 @@ id="limitChoices" ref="limitChoices" disabled={opts.disabled} - checkboxchecked={opts.config.maxChoiceNumber > 0} + checkboxchecked={config.maxChoiceNumber > 0} ontogglecheckbox={toggleLimitChoices}/> </div> - <div show={opts.config.maxChoiceNumber > 0} class="o-form-element"> + <div show={config.maxChoiceNumber > 0} class="o-form-element"> <label class="c-label" for="maxChoiceNumber"> {_t.maxChoiceNumber} </label> @@ -39,7 +39,7 @@ ref="maxChoiceNumber" class="c-field c-field--label" disabled={opts.disabled} - value={Math.max(1, opts.config.maxChoiceNumber)} + value={Math.max(1, config.maxChoiceNumber)} min="1" max="{opts.countChoices}" type="number" onchange={maxChoiceNumberChange}> @@ -50,11 +50,13 @@ this.installBundle(session, "poll_settings_voteCountingConfig"); + this.config = this.opts.config; + this.toggleLimitChoices = () => { - if (this.opts.config.maxChoiceNumber === 0 || typeof this.opts.config.maxChoiceNumber === "undefined") { - this.opts.config.maxChoiceNumber = this.opts.countChoices; + if (this.config.maxChoiceNumber === 0 || typeof this.config.maxChoiceNumber === "undefined") { + this.config.maxChoiceNumber = this.opts.countChoices; } else { - this.opts.config.maxChoiceNumber = 0; + this.config.maxChoiceNumber = 0; } if (this.opts.onchange) { this.opts.onchange(); @@ -63,7 +65,7 @@ }; this.maxChoiceNumberChange = () => { - this.opts.config.maxChoiceNumber = this.refs.maxChoiceNumber.valueAsNumber; + this.config.maxChoiceNumber = this.refs.maxChoiceNumber.valueAsNumber; if (this.opts.onchange) { this.opts.onchange(); } @@ -75,6 +77,11 @@ }; }; + this.listen("questionEditedChanged", () => { + //this.config = this.form.model.questions[this.form.questionEdited].voteCountingConfig; + this.update(); + }); + </script> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.