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 3579daafbb1da80eeff5521aaeee909b1b78effc Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon May 29 15:03:55 2017 +0200 les regExp dans les expression riot ne sont pas compiler correctement pas --- .../src/main/web/tag/poll/ChoiceView.tag.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceView.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceView.tag.html index 0cbb354..faaebc9 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceView.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceView.tag.html @@ -15,11 +15,11 @@ {formatDate(parseInt(opts.choice.choiceValue, 10))} </span> <div class="choice-ressource" - if={opts.choice.choiceType === "RESOURCE" && meta && meta.contentType.match(/^image\//i)}> + if={opts.choice.choiceType === "RESOURCE" && meta && isImage(meta)}> <img class="image-preview" src="{session.configuration.endPoint}/v1/resources/{opts.choice.choiceValue}/preview"/> </div> <div class="choice-ressource" - if={opts.choice.choiceType === "RESOURCE" && meta && !meta.contentType.match(/^image\//i)}> + if={opts.choice.choiceType === "RESOURCE" && meta && !isImage(meta)}> {meta.name} </div> <div if={opts.choice.choiceType === "RESOURCE" || opts.choice.description} class="info"> @@ -41,14 +41,15 @@ <h2 if={opts.choice.choiceType === "DATETIME"}> {formatDate(parseInt(opts.choice.choiceValue, 10))} </h2> - <div if={opts.choice.choiceType === "RESOURCE" && meta && meta.contentType.match(/^image\//i)}> - <img if={meta && meta.contentType.match(/^image\//i)} + <div if={opts.choice.choiceType === "RESOURCE" && meta && isImage(meta)}> + <img if={meta && isImage(meta)} class="image-preview" src="{session.configuration.endPoint}/v1/resources/{opts.choice.choiceValue}"/> </div> - <div if={opts.choice.choiceType === "RESOURCE" && meta && !meta.contentType.match(/^image\//i)}> + <div if={opts.choice.choiceType === "RESOURCE" && meta && !isImage(meta)}> <h2>{meta.name}</h2> - <a class="c-button c-button--info"if={meta && !meta.contentType.match(/^image\//i)} + <a class="c-button c-button--info" + if={meta && !isImage(meta)} href="{session.configuration.endPoint}/v1/resources/{opts.choice.choiceValue}/download" target="_blank"> <i class="fa fa-download"></i> @@ -77,6 +78,10 @@ }); } + this.isImage = (meta) => { + return meta.contentType.match(/^image\//i); + }; + this.openModalImage = () => { if (this.opts.choice.description || this.opts.choice.choiceType === "RESOURCE") { this.showModalImage = true; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.