From aa974aa54ab6e5b7db7450206d12b44ffb3a0306 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Thu, 22 Oct 2015 04:02:12 +0200 Subject: Prefer ES5 methods over underscore utilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- client/components/cards/cardDetails.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'client/components/cards/cardDetails.js') 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'); -- cgit v1.2.3-1-g7c22