summaryrefslogtreecommitdiffstats
path: root/client/components/activities/comments.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/activities/comments.js')
-rw-r--r--client/components/activities/comments.js10
1 files changed, 6 insertions, 4 deletions
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);
}