branch develop updated (9f0b04b1 -> 8d467892)
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 9f0b04b1 fixes #107 Choix de type resource avec un fichier sans extension new 8d467892 fixes #109 Letter avatar avec un seul lettre 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 8d46789248898ef45781b5cd2c293070ef45e706 Author: Kevin Morin <morin@codelutin.com> Date: Thu Aug 3 18:07:33 2017 +0200 fixes #109 Letter avatar avec un seul lettre Summary of changes: .../src/main/web/tag/components/LetterAvatar.tag.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 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 8d46789248898ef45781b5cd2c293070ef45e706 Author: Kevin Morin <morin@codelutin.com> Date: Thu Aug 3 18:07:33 2017 +0200 fixes #109 Letter avatar avec un seul lettre --- .../src/main/web/tag/components/LetterAvatar.tag.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/components/LetterAvatar.tag.html b/pollen-ui-riot-js/src/main/web/tag/components/LetterAvatar.tag.html index ffb5efc8..e6d0df88 100644 --- a/pollen-ui-riot-js/src/main/web/tag/components/LetterAvatar.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/components/LetterAvatar.tag.html @@ -11,9 +11,14 @@ if (this.opts.name.trim().length > 0) { let nameSplit = this.opts.name.split(); this.avatarLetter = nameSplit[0][0].toUpperCase(); - let secondLetter = (nameSplit.length > 1 ? nameSplit[1][0] : nameSplit[0][1]).toUpperCase(); + let secondLetter = null; + if (nameSplit.length > 1) { + secondLetter = nameSplit[1][0].toUpperCase(); + } else if (nameSplit[0].length > 1) { + secondLetter = nameSplit[0][1].toUpperCase(); + } let letterIndex = this.avatarLetter.charCodeAt() - 64; - let secondIndex = secondLetter.charCodeAt() - 64; + let secondIndex = secondLetter ? secondLetter.charCodeAt() - 64 : 0; let hue = (360 / (26 * 26)) * (secondIndex * 26 + letterIndex); this.backgroundColor = "hsl(" + hue + ", 68%, 48%)"; } else { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm