diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-09-03 23:12:46 +0200 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-09-03 23:12:46 +0200 |
commit | b3851817ecd59b039f2c2228d08a1c6fd8e60d60 (patch) | |
tree | 82a50f69788d5c20632f3ec9c7d3e136502b93b4 /client/components/main/popup.js | |
parent | 039cfe7edf8faf901069a94b3ca9b66f7973b26a (diff) | |
download | wekan-b3851817ecd59b039f2c2228d08a1c6fd8e60d60.tar.gz wekan-b3851817ecd59b039f2c2228d08a1c6fd8e60d60.tar.bz2 wekan-b3851817ecd59b039f2c2228d08a1c6fd8e60d60.zip |
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).
Diffstat (limited to 'client/components/main/popup.js')
-rw-r--r-- | client/components/main/popup.js | 20 |
1 files changed, 10 insertions, 10 deletions
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); }); - } + }, }; }); |