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 b536d5ebd467fe9244dc8900266653505a0c543f Author: jcouteau <couteau@codelutin.com> Date: Tue Jan 12 16:56:28 2021 +0100 :bug: fixes #360 fixes #359 : Vieux reliquat sur l'ajout des questions --- .../src/main/web/tag/poll/VotesTable.tag.html | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html index af2d3f12..819291a7 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/VotesTable.tag.html @@ -24,7 +24,7 @@ <div class="row header separator-bottom"> <div></div> <div class="choices separator-left" if="{showChoiceHeader}"> - <div each="{choice in poll.choices}" class="choice separator-top separator-right" + <div each="{choice in poll.questions[0].choices}" class="choice separator-top separator-right" onmouseenter="{parent.showTooltip(null, choice)}" onclick="{parent.showTooltip(null, choice)}" onmouseleave="{parent.hideTooltip}"> <ChoiceView choice={choice} center="true" hideReport="true"></ChoiceView> </div> @@ -55,7 +55,7 @@ </button> </div> <div class="results separator-left {'ignored': element.ignored}" ref="results{index}"> - <div each="{choice in parent.parent.poll.choices}" + <div each="{choice in parent.parent.poll.questions[0].choices}" class="result separator-right {'checkbox' : parent.parent.parent.pollTypeCheckbox} {'selected' : parent.parent.parent.pollTypeCheckbox && parent.parent.parent.poll.getVoteValue(element, choice) == 1}" onmouseenter="{parent.parent.parent.showTooltip(element, choice)}" onclick="{parent.parent.parent.showTooltip(element, choice)}" onmouseleave="{parent.parent.parent.hideTooltip}"> <span if="{!parent.parent.parent.pollTypeCheckbox}">{parent.parent.parent.poll.getVoteValue(element, choice)}</span> @@ -72,7 +72,7 @@ </div> </div> <div class="results separator-left" ref="results{index}"> - <div each="{choice in parent.poll.choices}" + <div each="{choice in parent.poll.questions[0].choices}" class="result separator-right"> <i class="fa fa-spinner fa-pulse" aria-hidden="true"></i> </div> @@ -113,6 +113,10 @@ desc: true }; + this.on("mount", function() { + this.refresh(); + }); + this.lazyLoad = pagination => { return this.poll.loadLazyVotes(this.poll.questions[0].id, pagination).then((result) => { this.loaded = result.pagination.count > 0; @@ -124,18 +128,30 @@ this.refresh = () => { this.refs.lazyLoad && this.refs.lazyLoad.reload().then(() => { this.updateShowChoiceContainer(); + this.updateVoteType(); this.update(); }, () => {}); }; + this.updateVoteType = () => { + if (!this.poll.questions[0].voteCountingTypeValue) { + this.poll.reloadVoteCountingTypeValue(this.poll.questions[0]).then(() => { + this.pollTypeCheckbox = this.poll.questions[0].voteCountingTypeValue && this.poll.questions[0].voteCountingTypeValue.renderType === "checkbox"; + this.update(); + }); + } else { + this.pollTypeCheckbox = this.poll.questions[0].voteCountingTypeValue && this.poll.questions[0].voteCountingTypeValue.renderType === "checkbox"; + } + } + this.updateShowChoiceContainer = () => { let results0 = this.refs.lazyLoad && this.refs.lazyLoad.refs.results0; - this.showChoiceHeader = results0 && this.poll.choices && results0.offsetWidth / this.poll.choices.length >= MIN_CHOICE_COLUMN_WIDTH; + this.showChoiceHeader = results0 && this.poll.questions[0].choices && results0.offsetWidth / this.poll.questions[0].choices.length >= MIN_CHOICE_COLUMN_WIDTH; }; this.onPollChange = poll2 => { this.poll = poll2; - this.pollTypeCheckbox = poll2.voteCountingTypeValue && poll2.voteCountingTypeValue.renderType === "checkbox"; + this.updateVoteType(); this.refresh(); this.update(); }; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.