summaryrefslogtreecommitdiffstats
path: root/client
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
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')
-rw-r--r--client/components/cards/details.js8
-rw-r--r--client/components/lists/body.js3
-rw-r--r--client/components/lists/main.js16
-rw-r--r--client/components/lists/menu.js4
-rw-r--r--client/components/main/helpers.js6
5 files changed, 20 insertions, 17 deletions
diff --git a/client/components/cards/details.js b/client/components/cards/details.js
index a4fe89a3..cb1a3ef3 100644
--- a/client/components/cards/details.js
+++ b/client/components/cards/details.js
@@ -53,7 +53,7 @@ BlazeComponent.extendComponent({
event.preventDefault();
},
- 'click .js-cancel-edit': function(event, t) {
+ 'click .js-cancel-edit': function() {
// remove editing hide.
$('.editing').removeClass('editing');
},
@@ -64,8 +64,8 @@ BlazeComponent.extendComponent({
$set: {
title: title
}
- }, function (err, res) {
- if (!err) $('.editing').removeClass('editing');
+ }, function(err) {
+ if (! err) $('.editing').removeClass('editing');
});
}
@@ -77,7 +77,7 @@ BlazeComponent.extendComponent({
description: t.find('#desc').value
}
}, function(err) {
- if (!err) $('.editing').removeClass('editing');
+ if (! err) $('.editing').removeClass('editing');
});
event.preventDefault();
},
diff --git a/client/components/lists/body.js b/client/components/lists/body.js
index fa6ec096..31e43160 100644
--- a/client/components/lists/body.js
+++ b/client/components/lists/body.js
@@ -61,7 +61,8 @@ BlazeComponent.extendComponent({
var list = $('#js-list-' + this.data()._id);
var nextList = list[isReverse ? 'prev' : 'next']('.js-list').get(0) ||
$('.js-list:' + (isReverse ? 'last' : 'first')).get(0);
- var nextListComponent = BlazeComponent.getComponentForElement(nextList);
+ var nextListComponent =
+ BlazeComponent.getComponentForElement(nextList);
// XXX Get the real position
var position = 'bottom';
diff --git a/client/components/lists/main.js b/client/components/lists/main.js
index 3d458055..243779b3 100644
--- a/client/components/lists/main.js
+++ b/client/components/lists/main.js
@@ -1,4 +1,4 @@
-ListComponent = BlazeComponent.extendComponent({
+BlazeComponent.extendComponent({
template: function() {
return 'list';
},
@@ -27,19 +27,19 @@ ListComponent = BlazeComponent.extendComponent({
if (Meteor.user().isBoardMember()) {
var $cards = this.$('.js-minicards');
$cards.sortable({
- connectWith: ".js-minicards",
+ connectWith: '.js-minicards',
tolerance: 'pointer',
appendTo: '.js-lists',
- helper: "clone",
+ helper: 'clone',
items: '.js-minicard:not(.placeholder, .hide, .js-composer)',
placeholder: 'minicard placeholder',
- start: function (event, ui) {
+ start: function(event, ui) {
$('.minicard.placeholder').height(ui.item.height());
Popup.close();
},
stop: function(event, ui) {
- // To attribute the new index number, we need to get the dom element of
- // the previous and the following card -- if any.
+ // To attribute the new index number, we need to get the dom element
+ // of the previous and the following card -- if any.
var cardDomElement = ui.item.get(0);
var prevCardDomElement = ui.item.prev('.js-minicard').get(0);
var nextCardDomElement = ui.item.next('.js-minicard').get(0);
@@ -57,7 +57,7 @@ ListComponent = BlazeComponent.extendComponent({
Utils.liveEvent('mouseover', function($el) {
$el.find('.js-member-droppable').droppable({
- hoverClass: "draggable-hover-card",
+ hoverClass: 'draggable-hover-card',
accept: '.js-member',
drop: function(event, ui) {
var memberId = Blaze.getData(ui.draggable.get(0)).userId;
@@ -67,7 +67,7 @@ ListComponent = BlazeComponent.extendComponent({
});
$el.find('.js-member-droppable').droppable({
- hoverClass: "draggable-hover-card",
+ hoverClass: 'draggable-hover-card',
accept: '.js-label',
drop: function(event, ui) {
var labelId = Blaze.getData(ui.draggable.get(0))._id;
diff --git a/client/components/lists/menu.js b/client/components/lists/menu.js
index ef08cf76..1e1eb53f 100644
--- a/client/components/lists/menu.js
+++ b/client/components/lists/menu.js
@@ -3,8 +3,8 @@ Template.listActionPopup.events({
// XXX We need a better API and architecture here. See
// https://github.com/peerlibrary/meteor-blaze-components/issues/19
var listDom = document.getElementById('js-list-' + this._id);
- var listComponent = Blaze.getView(listDom).templateInstance().get('component');
- listComponent.openForm();
+ var listInstance = Blaze.getView(listDom).templateInstance();
+ listInstance.get('component').openForm();
Popup.close();
},
'click .js-list-subscribe': function() {},
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));