branch develop updated (77015778 -> fa815e90)
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 77015778 refs #108 fix linter errors new fa815e90 refs #108 handle keyboard navigation in the carousel 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 fa815e90f4b401eba3c81169151b9be36fa80d3f Author: Kevin Morin <morin@codelutin.com> Date: Fri Sep 3 09:17:35 2021 +0200 refs #108 handle keyboard navigation in the carousel Summary of changes: .../src/main/web/tag/popup/ChoiceDetailModal.tag.html | 15 ++++++++++++++- 1 file changed, 14 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 fa815e90f4b401eba3c81169151b9be36fa80d3f Author: Kevin Morin <morin@codelutin.com> Date: Fri Sep 3 09:17:35 2021 +0200 refs #108 handle keyboard navigation in the carousel --- .../src/main/web/tag/popup/ChoiceDetailModal.tag.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/popup/ChoiceDetailModal.tag.html b/pollen-ui-riot-js/src/main/web/tag/popup/ChoiceDetailModal.tag.html index 9c19b5e5..d123c3f6 100644 --- a/pollen-ui-riot-js/src/main/web/tag/popup/ChoiceDetailModal.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/popup/ChoiceDetailModal.tag.html @@ -24,7 +24,8 @@ import "../components/MultiLineLabel.tag.html"; ref="modal" only-ok="true"> - <div if={parent.choice && parent.choice.choiceType === "RESOURCE" && parent.meta} class="resource-container"> + <div if={parent.choice && parent.choice.choiceType === "RESOURCE" && parent.meta} + class="resource-container"> <a if={parent.resourceChoices.length > 1} class="carousel-button" onclick="{parent.previousResource}"> @@ -73,6 +74,8 @@ import "../components/MultiLineLabel.tag.html"; this.resourceChoices = []; this.loading = false; + document.addEventListener("keydown", event => this.handleKeyPress(event)); + this.onPollChange = poll => { this.resourceChoices = poll.questions[0].choices.filter(choice => choice.choiceType === "RESOURCE"); }; @@ -92,6 +95,16 @@ import "../components/MultiLineLabel.tag.html"; return promise; }; + this.handleKeyPress = event => { + if (event.keyCode === 37) { + event.preventDefault(); + this.previousResource(); + } else if (event.keyCode === 39) { + event.preventDefault(); + this.nextResource(); + } + }; + this.nextResource = () => { let choiceIndex = this.resourceChoices.indexOf(this.choice); this.setResource((choiceIndex + 1) % this.resourceChoices.length); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm