summaryrefslogtreecommitdiffstats
path: root/client/components/cards
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-10-22 04:02:12 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-10-22 18:13:12 +0200
commitaa974aa54ab6e5b7db7450206d12b44ffb3a0306 (patch)
treeb501ee16fa630e19b95d99ffc3984e30301e096a /client/components/cards
parentc6b12dc5ada1b37d759796fefe0dbc5b327f130c (diff)
downloadwekan-aa974aa54ab6e5b7db7450206d12b44ffb3a0306.tar.gz
wekan-aa974aa54ab6e5b7db7450206d12b44ffb3a0306.tar.bz2
wekan-aa974aa54ab6e5b7db7450206d12b44ffb3a0306.zip
Prefer ES5 methods over underscore utilities
Since 07cc454 (ie the switch to Meteor 1.2) we includes the `es5-shim` polyfill to support methods like `Array.prototype.forEach` in a consistent way across all supported browsers (IE8+). MDG recently released a blog post recommending the use of these native methods instead of underscore [0]. We know follow this recommendation. This commit also favor some ES6 features (argument defaults, destructing assignment) in places where we didn’t use them. [0]: http://info.meteor.com/blog/es2015-get-started
Diffstat (limited to 'client/components/cards')
-rw-r--r--client/components/cards/cardDetails.js5
-rw-r--r--client/components/cards/labels.js2
2 files changed, 4 insertions, 3 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 5e07abab..2d2679ec 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -62,7 +62,8 @@ BlazeComponent.extendComponent({
},
};
- return [_.extend(events, {
+ return [{
+ ...events,
'click .js-close-card-details'() {
Utils.goBoardId(this.data().boardId);
},
@@ -86,7 +87,7 @@ BlazeComponent.extendComponent({
this.parentComponent().showOverlay.set(true);
this.parentComponent().mouseHasEnterCardDetails = true;
},
- })];
+ }];
},
}).register('cardDetails');
diff --git a/client/components/cards/labels.js b/client/components/cards/labels.js
index 6a411561..4e61a0c6 100644
--- a/client/components/cards/labels.js
+++ b/client/components/cards/labels.js
@@ -13,7 +13,7 @@ BlazeComponent.extendComponent({
},
labels() {
- return _.map(labelColors, (color) => {
+ return labelColors.map((color) => {
return { color, name: '' };
});
},