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/lists/listBody.js | 6 +++--- client/components/lists/listHeader.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'client/components/lists') diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 88b31788..25aeffcc 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -12,7 +12,7 @@ BlazeComponent.extendComponent({ options.position = options.position || 'top'; const forms = this.childrenComponents('inlinedForm'); - let form = _.find(forms, (component) => { + let form = forms.find((component) => { return component.data().position === options.position; }); if (!form && forms.length > 0) { @@ -26,7 +26,7 @@ BlazeComponent.extendComponent({ const firstCardDom = this.find('.js-minicard:first'); const lastCardDom = this.find('.js-minicard:last'); const textarea = $(evt.currentTarget).find('textarea'); - const title = textarea.val(); + const title = textarea.val().trim(); const position = this.currentData().position; let sortIndex; if (position === 'top') { @@ -35,7 +35,7 @@ BlazeComponent.extendComponent({ sortIndex = Utils.calculateIndex(lastCardDom, null).base; } - if ($.trim(title)) { + if (title) { const _id = Cards.insert({ title, listId: this.data()._id, diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js index b5df2c81..ab547f02 100644 --- a/client/components/lists/listHeader.js +++ b/client/components/lists/listHeader.js @@ -6,9 +6,9 @@ BlazeComponent.extendComponent({ editTitle(evt) { evt.preventDefault(); const newTitle = this.childrenComponents('inlinedForm')[0].getValue(); - const list = this.currentData(); - if ($.trim(newTitle)) { - list.rename(newTitle); + const list = this.currentData().trim(); + if (newTitle) { + list.rename(newTitle.trim()); } }, -- cgit v1.2.3-1-g7c22