From b3851817ecd59b039f2c2228d08a1c6fd8e60d60 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Thu, 3 Sep 2015 23:12:46 +0200 Subject: Enforce a consistent ES6 coding style Replace the old (and broken) jshint + jscsrc by eslint and configure it to support some of the ES6 features. The command `eslint` currently has one error which is a bug that was discovered by its static analysis and should be fixed (usage of a dead object). --- client/components/main/popup.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'client/components/main/popup.js') diff --git a/client/components/main/popup.js b/client/components/main/popup.js index 5fc4e979..ba20a6d3 100644 --- a/client/components/main/popup.js +++ b/client/components/main/popup.js @@ -1,11 +1,11 @@ Popup.template.events({ - 'click .js-back-view': function() { + 'click .js-back-view'() { Popup.back(); }, - 'click .js-close-pop-over': function() { + 'click .js-close-pop-over'() { Popup.close(); }, - 'click .js-confirm': function() { + 'click .js-confirm'() { this.__afterConfirmAction.call(this); }, // This handler intends to solve a pretty tricky bug with our popup @@ -18,22 +18,22 @@ Popup.template.events({ // in moving the whole popup container outside of the popup wrapper. To // disable this behavior we have to manually reset the scrollLeft position // whenever it is modified. - 'scroll .content-wrapper': function(evt) { + 'scroll .content-wrapper'(evt) { evt.currentTarget.scrollLeft = 0; - } + }, }); // When a popup content is removed (ie, when the user press the "back" button), // we need to wait for the container translation to end before removing the // actual DOM element. For that purpose we use the undocumented `_uihooks` API. -Popup.template.onRendered(function() { - var container = this.find('.content-container'); +Popup.template.onRendered(() => { + const container = this.find('.content-container'); container._uihooks = { - removeElement: function(node) { + removeElement(node) { $(node).addClass('no-height'); - $(container).one(CSSEvents.transitionend, function() { + $(container).one(CSSEvents.transitionend, () => { node.parentNode.removeChild(node); }); - } + }, }; }); -- cgit v1.2.3-1-g7c22