diff options
author | Xavier Priour <xavier.priour@bubblyware.com> | 2015-11-13 12:43:34 +0100 |
---|---|---|
committer | Xavier Priour <xavier.priour@bubblyware.com> | 2015-11-13 12:43:34 +0100 |
commit | a7427b9ae4e790989c49408ffe14aea4976db305 (patch) | |
tree | 3b56c753ce05ba9a5253078e2792b2c485d2912e /client/components/activities | |
parent | 3dc70b3ea4d49bccb10d4f2b3e317c794da91e37 (diff) | |
parent | cb3bd86396e4d19e1f05fcb94e3527f81e70412e (diff) | |
download | wekan-a7427b9ae4e790989c49408ffe14aea4976db305.tar.gz wekan-a7427b9ae4e790989c49408ffe14aea4976db305.tar.bz2 wekan-a7427b9ae4e790989c49408ffe14aea4976db305.zip |
merge with /devel
Diffstat (limited to 'client/components/activities')
-rw-r--r-- | client/components/activities/activities.js | 4 | ||||
-rw-r--r-- | client/components/activities/comments.js | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js index a491c2e8..64e9865d 100644 --- a/client/components/activities/activities.js +++ b/client/components/activities/activities.js @@ -101,9 +101,9 @@ BlazeComponent.extendComponent({ }, 'submit .js-edit-comment'(evt) { evt.preventDefault(); - const commentText = this.currentComponent().getValue(); + const commentText = this.currentComponent().getValue().trim(); const commentId = Template.parentData().commentId; - if ($.trim(commentText)) { + if (commentText) { CardComments.update(commentId, { $set: { text: commentText, diff --git a/client/components/activities/comments.js b/client/components/activities/comments.js index 08401caa..18bf9ef0 100644 --- a/client/components/activities/comments.js +++ b/client/components/activities/comments.js @@ -24,11 +24,12 @@ BlazeComponent.extendComponent({ }, 'submit .js-new-comment-form'(evt) { const input = this.getInput(); - if ($.trim(input.val())) { + const text = input.val().trim(); + if (text) { CardComments.insert({ + text, boardId: this.currentData().boardId, cardId: this.currentData()._id, - text: input.val(), }); resetCommentInput(input); Tracker.flush(); @@ -72,8 +73,9 @@ EscapeActions.register('inlinedForm', docId: Session.get('currentCard'), }; const commentInput = $('.js-new-comment-input'); - if ($.trim(commentInput.val())) { - UnsavedEdits.set(draftKey, commentInput.val()); + const draft = commentInput.val().trim(); + if (draft) { + UnsavedEdits.set(draftKey, draft); } else { UnsavedEdits.reset(draftKey); } |