summaryrefslogtreecommitdiffstats
path: root/client/components/main/helpers.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-05-14 14:27:39 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-05-14 14:28:47 +0200
commit22b8b6ab205eb2fe7abcd3fedfc108de12ef61d9 (patch)
tree14a8af5ef9ac4829c12317fe0ea4460d84f5c799 /client/components/main/helpers.js
parentfbc4c5e82ef75c6cbf37245c4eec30f4492f9dcc (diff)
downloadwekan-22b8b6ab205eb2fe7abcd3fedfc108de12ef61d9.tar.gz
wekan-22b8b6ab205eb2fe7abcd3fedfc108de12ef61d9.tar.bz2
wekan-22b8b6ab205eb2fe7abcd3fedfc108de12ef61d9.zip
Style tweaks
Follows strictly jshint and jscs rules.
Diffstat (limited to 'client/components/main/helpers.js')
-rw-r--r--client/components/main/helpers.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/components/main/helpers.js b/client/components/main/helpers.js
index 7ad602f1..91205351 100644
--- a/client/components/main/helpers.js
+++ b/client/components/main/helpers.js
@@ -45,7 +45,7 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() {
var mentionRegex = /\B@(\w*)/gi;
var currentMention, knowedUser, href, linkClass, linkValue, link;
- while (currentMention = mentionRegex.exec(content)) {
+ while (!! (currentMention = mentionRegex.exec(content))) {
knowedUser = _.findWhere(knowedUsers, { username: currentMention[1] });
if (! knowedUser)
@@ -53,7 +53,9 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() {
linkValue = [' ', at, knowedUser.username];
href = Router.url('Profile', { username: knowedUser.username });
- linkClass = 'atMention' + (knowedUser.userId === Meteor.userId() ? ' me' : '');
+ linkClass = 'atMention';
+ if (knowedUser.userId === Meteor.userId())
+ linkClass += ' me';
link = HTML.A({ href: href, 'class': linkClass }, linkValue);
content = content.replace(currentMention[0], Blaze.toHTML(link));