summaryrefslogtreecommitdiffstats
path: root/client/components/activities/comments.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-09-03 23:12:46 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-09-03 23:12:46 +0200
commitb3851817ecd59b039f2c2228d08a1c6fd8e60d60 (patch)
tree82a50f69788d5c20632f3ec9c7d3e136502b93b4 /client/components/activities/comments.js
parent039cfe7edf8faf901069a94b3ca9b66f7973b26a (diff)
downloadwekan-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/activities/comments.js')
-rw-r--r--client/components/activities/comments.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/client/components/activities/comments.js b/client/components/activities/comments.js
index e3a82c4b..08401caa 100644
--- a/client/components/activities/comments.js
+++ b/client/components/activities/comments.js
@@ -1,4 +1,4 @@
-let commentFormIsOpen = new ReactiveVar(false);
+const commentFormIsOpen = new ReactiveVar(false);
BlazeComponent.extendComponent({
template() {
@@ -19,16 +19,16 @@ BlazeComponent.extendComponent({
events() {
return [{
- 'click .js-new-comment:not(.focus)': function() {
+ 'click .js-new-comment:not(.focus)'() {
commentFormIsOpen.set(true);
},
- 'submit .js-new-comment-form': function(evt) {
- let input = this.getInput();
+ 'submit .js-new-comment-form'(evt) {
+ const input = this.getInput();
if ($.trim(input.val())) {
CardComments.insert({
boardId: this.currentData().boardId,
cardId: this.currentData()._id,
- text: input.val()
+ text: input.val(),
});
resetCommentInput(input);
Tracker.flush();
@@ -37,13 +37,13 @@ BlazeComponent.extendComponent({
evt.preventDefault();
},
// Pressing Ctrl+Enter should submit the form
- 'keydown form textarea': function(evt) {
+ 'keydown form textarea'(evt) {
if (evt.keyCode === 13 && (evt.metaKey || evt.ctrlKey)) {
this.find('button[type=submit]').click();
}
- }
+ },
}];
- }
+ },
}).register('commentForm');
// XXX This should be a static method of the `commentForm` component
@@ -63,15 +63,15 @@ Tracker.autorun(() => {
Tracker.afterFlush(() => {
autosize.update($('.js-new-comment-input'));
});
-})
+});
EscapeActions.register('inlinedForm',
- function() {
+ () => {
const draftKey = {
fieldName: 'cardComment',
- docId: Session.get('currentCard')
+ docId: Session.get('currentCard'),
};
- let commentInput = $('.js-new-comment-input');
+ const commentInput = $('.js-new-comment-input');
if ($.trim(commentInput.val())) {
UnsavedEdits.set(draftKey, commentInput.val());
} else {
@@ -79,7 +79,7 @@ EscapeActions.register('inlinedForm',
}
resetCommentInput(commentInput);
},
- function() { return commentFormIsOpen.get(); }, {
- noClickEscapeOn: '.js-new-comment'
+ () => { return commentFormIsOpen.get(); }, {
+ noClickEscapeOn: '.js-new-comment',
}
);