Style tweaks

Follows strictly jshint and jscs rules.
This commit is contained in:
Maxime Quandalle 2015-05-14 14:27:39 +02:00
parent fbc4c5e82e
commit 22b8b6ab20
8 changed files with 23 additions and 19 deletions

View file

@ -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));