branch develop updated (dc466a52 -> 5aa98831)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from dc466a52 fxes #68 message d'erreur différent si le compte n'est pas validé new 5aa98831 fixes #82 focus sur les nouveaux choix 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 5aa98831e51d6f9856abaee5907d57dfb704b0d3 Author: Kevin Morin <morin@codelutin.com> Date: Tue Jul 18 15:07:54 2017 +0200 fixes #82 focus sur les nouveaux choix Summary of changes: pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html | 12 ++++++++++++ pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) -- 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 develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 5aa98831e51d6f9856abaee5907d57dfb704b0d3 Author: Kevin Morin <morin@codelutin.com> Date: Tue Jul 18 15:07:54 2017 +0200 fixes #82 focus sur les nouveaux choix --- pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html | 12 ++++++++++++ pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html index 32df6368..dfcda103 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html @@ -133,6 +133,8 @@ require("../components/time-picker.tag.html"); }; } + this.on("mount", this.focus); + this.setTextType = () => { this.opts.choice.choiceType = "TEXT"; }; @@ -222,6 +224,16 @@ require("../components/time-picker.tag.html"); this.refs.choiceResource.value = ""; }; + this.focus = () => { + if (this.opts.choice.choiceType === "TEXT") { + this.refs.choiceText.focus(); + } else if (this.opts.choice.choiceType === "RESOURCE") { + this.refs.choiceResource.focus(); + } else { + this.refs.choiceDate.focus(); + } + }; + </script> <style> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html index 2130a4e1..1dc4b270 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html @@ -5,7 +5,7 @@ require("./Choice.tag.html"); class="o-form-element"> <div class="c-input-group"> <div class="o-field"> - <Choice ref="choice" + <Choice ref="choice{index}" class="choice c-field" name={"choice" + index} disabled={form.hasVotes} @@ -37,10 +37,16 @@ require("./Choice.tag.html"); this.choiceType = this.form.choiceType || "TEXT"; this.installBundle(this.session, "poll_choices", this.opts.emitter); + this.on("mount", () => { + this.refs["choice0"].focus(); + }); + this.addOneChoice = () => { if (!this.form.hasVotes) { this.submit(); this.form.addNewChoice(); + this.update(); + this.refs["choice" + (this.form.choices.length - 1)].focus(); } }; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm