branch feature/232-miseAJourAutoSondage created (now e1b7067f)
This is an automated email from the git hooks/post-receive script. New change to branch feature/232-miseAJourAutoSondage in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git at e1b7067f fixes #232 : Mise à jour automatique d'un sondage This branch includes the following new commits: new e1b7067f fixes #232 : Mise à jour automatique d'un sondage The 1 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 e1b7067ff084e77bf2c0687f6a144a9de92b3a5b Author: jcouteau <couteau@codelutin.com> Date: Mon Dec 2 15:20:12 2019 +0100 fixes #232 : Mise à jour automatique d'un sondage -- 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/232-miseAJourAutoSondage in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit e1b7067ff084e77bf2c0687f6a144a9de92b3a5b Author: jcouteau <couteau@codelutin.com> Date: Mon Dec 2 15:20:12 2019 +0100 fixes #232 : Mise à jour automatique d'un sondage --- .../src/main/web/tag/poll/Poll.tag.html | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html index 7ad89a08..724af110 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html @@ -195,6 +195,35 @@ } }); + this.refresh = function() { + window.setInterval(function() { + if (this.poll) { + this.poll.reload(); + } + + //this.refresh(); + }, 1000); + }; + + this.refresh(); + + this.refresh = () => { + if (this.poll) { + let promise = this.poll.reloadPoll(); + promise.then(poll2 => { + this.poll = poll2; + this.update(); + }, () => {}); + }; + }; + + this.refresh(); + this.intervalId = window.setInterval(this.refresh, 60000); + + this.on("unmount", () => { + window.clearInterval(this.intervalId); + }); + this.listen("locale", ()=> { this.poll.questions.forEach(question => { this.poll.reloadVoteCountingTypeValue(question).then(() => { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm