From 31b60d82fcae64a844805a2a76a0af25fb9c16c2 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 23 Oct 2015 16:56:55 +0200 Subject: Upgrade Meteor to 1.2.1-rc4 This version includes a more complete selection of ES2015 polyfills that I started used across the code base, for instance by replacing `$.trim(str)` by `str.trim()`. --- client/components/activities/activities.js | 4 ++-- client/components/activities/comments.js | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'client/components/activities') 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..f9bbcff8 100644 --- a/client/components/activities/comments.js +++ b/client/components/activities/comments.js @@ -23,12 +23,13 @@ BlazeComponent.extendComponent({ commentFormIsOpen.set(true); }, 'submit .js-new-comment-form'(evt) { - const input = this.getInput(); - if ($.trim(input.val())) { + const input = this.getInput() + 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); } -- cgit v1.2.3-1-g7c22 From 3ad672a20b8e216684bbcb932b792d67548c2484 Mon Sep 17 00:00:00 2001 From: Dominik Ferber Date: Tue, 27 Oct 2015 17:38:04 +0100 Subject: Add missing semicolon --- client/components/activities/comments.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/activities') diff --git a/client/components/activities/comments.js b/client/components/activities/comments.js index f9bbcff8..18bf9ef0 100644 --- a/client/components/activities/comments.js +++ b/client/components/activities/comments.js @@ -23,7 +23,7 @@ BlazeComponent.extendComponent({ commentFormIsOpen.set(true); }, 'submit .js-new-comment-form'(evt) { - const input = this.getInput() + const input = this.getInput(); const text = input.val().trim(); if (text) { CardComments.insert({ -- cgit v1.2.3-1-g7c22