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/cards/attachments.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/cards/attachments.js')
-rw-r--r-- | client/components/cards/attachments.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index 9e299cc0..ba56aa1a 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -1,32 +1,32 @@ Template.attachmentsGalery.events({ 'click .js-add-attachment': Popup.open('cardAttachments'), 'click .js-confirm-delete': Popup.afterConfirm('attachmentDelete', - function() { + () => { Attachments.remove(this._id); Popup.close(); } ), // If we let this event bubble, FlowRouter will handle it and empty the page // content, see #101. - 'click .js-download': function(event) { + 'click .js-download'(event) { event.stopPropagation(); }, - 'click .js-open-viewer': function() { + 'click .js-open-viewer'() { // XXX Not implemented! }, - 'click .js-add-cover': function() { + 'click .js-add-cover'() { Cards.update(this.cardId, { $set: { coverId: this._id } }); }, - 'click .js-remove-cover': function() { + 'click .js-remove-cover'() { Cards.update(this.cardId, { $unset: { coverId: '' } }); - } + }, }); Template.cardAttachmentsPopup.events({ - 'change .js-attach-file': function(evt) { - var card = this; - FS.Utility.eachFile(evt, function(f) { - var file = new FS.File(f); + 'change .js-attach-file'(evt) { + const card = this; + FS.Utility.eachFile(evt, (f) => { + const file = new FS.File(f); file.boardId = card.boardId; file.cardId = card._id; @@ -34,8 +34,8 @@ Template.cardAttachmentsPopup.events({ Popup.close(); }); }, - 'click .js-computer-upload': function(evt, tpl) { + 'click .js-computer-upload'(evt, tpl) { tpl.find('.js-attach-file').click(); evt.preventDefault(); - } + }, }); |