diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-10-31 10:27:20 +0100 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-10-31 12:49:58 +0100 |
commit | 2b134ff7a986eb97f8ec360321be284a7a8ea11e (patch) | |
tree | 0ff579909b402db5916b66ec7bc7469534881a15 /client/components/lists | |
parent | 3507c6565bb16b5f45c6f269f7376902f8b1ff37 (diff) | |
parent | 41b23f88aea0f421226f92b081cdb1b61c64bde4 (diff) | |
download | wekan-2b134ff7a986eb97f8ec360321be284a7a8ea11e.tar.gz wekan-2b134ff7a986eb97f8ec360321be284a7a8ea11e.tar.bz2 wekan-2b134ff7a986eb97f8ec360321be284a7a8ea11e.zip |
Merge branch 'devel' into minicard-editor
Conflicts:
client/components/lists/listBody.js
Diffstat (limited to 'client/components/lists')
-rw-r--r-- | client/components/lists/list.js | 4 | ||||
-rw-r--r-- | client/components/lists/listBody.js | 10 | ||||
-rw-r--r-- | client/components/lists/listHeader.jade | 1 | ||||
-rw-r--r-- | client/components/lists/listHeader.js | 8 |
4 files changed, 13 insertions, 10 deletions
diff --git a/client/components/lists/list.js b/client/components/lists/list.js index af9bef98..75e816b5 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -7,7 +7,7 @@ BlazeComponent.extendComponent({ // Proxy openForm(options) { - this.componentChildren('listBody')[0].openForm(options); + this.childrenComponents('listBody')[0].openForm(options); }, onCreated() { @@ -25,7 +25,7 @@ BlazeComponent.extendComponent({ if (!Meteor.user() || !Meteor.user().isBoardMember()) return; - const boardComponent = this.componentParent(); + const boardComponent = this.parentComponent(); const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)'; const $cards = this.$('.js-minicards'); $cards.sortable({ diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index a60ffe25..2ed5d38a 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -11,8 +11,8 @@ BlazeComponent.extendComponent({ options = options || {}; options.position = options.position || 'top'; - const forms = this.componentChildren('inlinedForm'); - let form = _.find(forms, (component) => { + const forms = this.childrenComponents('inlinedForm'); + let form = forms.find((component) => { return component.data().position === options.position; }); if (!form && forms.length > 0) { @@ -26,8 +26,8 @@ BlazeComponent.extendComponent({ const firstCardDom = this.find('.js-minicard:first'); const lastCardDom = this.find('.js-minicard:last'); const textarea = $(evt.currentTarget).find('textarea'); - let title = textarea.val(); - const position = Blaze.getData(evt.currentTarget).position; + const position = this.currentData().position; + let title = textarea.val().trim(); let sortIndex; if (position === 'top') { sortIndex = Utils.calculateIndex(null, firstCardDom).base; @@ -62,7 +62,7 @@ BlazeComponent.extendComponent({ } }); - if ($.trim(title)) { + if (title) { const _id = Cards.insert({ title, listId: this.data()._id, diff --git a/client/components/lists/listHeader.jade b/client/components/lists/listHeader.jade index 7d01f1ba..72cd0fe9 100644 --- a/client/components/lists/listHeader.jade +++ b/client/components/lists/listHeader.jade @@ -25,6 +25,7 @@ template(name="listActionPopup") li: a.js-archive-cards {{_ 'list-archive-cards'}} hr ul.pop-over-list + li: a.js-import-card {{_ 'import-card'}} li: a.js-close-list {{_ 'archive-list'}} template(name="listMoveCardsPopup") diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js index a893e873..dbf9fced 100644 --- a/client/components/lists/listHeader.js +++ b/client/components/lists/listHeader.js @@ -5,10 +5,10 @@ BlazeComponent.extendComponent({ editTitle(evt) { evt.preventDefault(); - const newTitle = this.componentChildren('inlinedForm')[0].getValue(); + const newTitle = this.childrenComponents('inlinedForm')[0].getValue().trim(); const list = this.currentData(); - if ($.trim(newTitle)) { - list.rename(newTitle); + if (newTitle) { + list.rename(newTitle.trim()); } }, @@ -33,6 +33,7 @@ Template.listActionPopup.events({ MultiSelection.add(cardIds); Popup.close(); }, + 'click .js-import-card': Popup.open('listImportCard'), 'click .js-move-cards': Popup.open('listMoveCards'), 'click .js-archive-cards': Popup.afterConfirm('listArchiveCards', function() { this.allCards().forEach((card) => { @@ -40,6 +41,7 @@ Template.listActionPopup.events({ }); Popup.close(); }), + 'click .js-close-list'(evt) { evt.preventDefault(); this.archive(); |