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 56c2b402472427ce558501e603c1422b64ef03f7 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Oct 10 16:25:22 2017 +0200 Borda : mise a jour du nombre de rangs si le nombre de choix change --- .../src/main/web/tag/voteCountingType/BordaConfig.tag.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaConfig.tag.html b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaConfig.tag.html index e15a2653..3db0b682 100644 --- a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaConfig.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaConfig.tag.html @@ -75,9 +75,18 @@ require("./MaxChoicesNumberConfig.tag.html"); if (!this.opts.config.pointsByRank) { this.updatePointsByRank(); + } else { + let length = this.opts.config.maxChoiceNumber || this.opts.countChoices; + if (this.opts.config.pointsByRank.length < length) { + let nbRankToAdd = length - this.opts.config.pointsByRank.length; + let nextRanks = new Array(nbRankToAdd).fill(0); + this.opts.config.pointsByRank = this.opts.config.pointsByRank.concat(nextRanks); + } else if (this.opts.config.pointsByRank.length > length) { + let nbRankToRemove = this.opts.config.pointsByRank.length - length; + this.opts.config.pointsByRank.splice(length, nbRankToRemove); + } } - </script> <style> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.