summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-04-16 21:27:24 +0300
committerLauri Ojansivu <x@xet7.org>2018-04-16 21:27:24 +0300
commite402200b872026d0a01b89cf50578ab6b49bf103 (patch)
tree614bf240fd85826ab990ace8ba8ec2c5a9dc64d4 /client/components
parentaede4dd9c5c5a1f1654c4251dbf949761ff9b811 (diff)
parentea289c781075c893a0e3a6f05e96f3b3263f0466 (diff)
downloadwekan-e402200b872026d0a01b89cf50578ab6b49bf103.tar.gz
wekan-e402200b872026d0a01b89cf50578ab6b49bf103.tar.bz2
wekan-e402200b872026d0a01b89cf50578ab6b49bf103.zip
Merge branch 'devel'
Diffstat (limited to 'client/components')
-rw-r--r--client/components/cards/cardDetails.js33
-rw-r--r--client/components/lists/listHeader.js7
-rw-r--r--client/components/users/userHeader.jade2
3 files changed, 30 insertions, 12 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 421cef53..cdd027e6 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -343,9 +343,16 @@ Template.copyCardPopup.events({
cursor.forEach(function() {
'use strict';
const checklist = arguments[0];
+ const checklistId = checklist._id;
checklist.cardId = _id;
checklist._id = null;
- Checklists.insert(checklist);
+ const newChecklistId = Checklists.insert(checklist);
+ ChecklistItems.find({checklistId}).forEach(function(item) {
+ item._id = null;
+ item.checklistId = newChecklistId;
+ item.cardId = _id;
+ ChecklistItems.insert(item);
+ });
});
// copy card comments
@@ -363,17 +370,20 @@ Template.copyCardPopup.events({
});
Template.copyChecklistToManyCardsPopup.events({
- 'click .js-select-list' (evt) {
+ 'click .js-done' () {
const card = Cards.findOne(Session.get('currentCard'));
const oldId = card._id;
card._id = null;
- card.listId = this._id;
- const list = Lists.findOne(card.listId);
- card.boardId = list.boardId;
- const textarea = $(evt.currentTarget).parents('.content').find('textarea');
+ const lSelect = $('.js-select-lists')[0];
+ card.listId = lSelect.options[lSelect.selectedIndex].value;
+ const slSelect = $('.js-select-swimlanes')[0];
+ card.swimlaneId = slSelect.options[slSelect.selectedIndex].value;
+ const bSelect = $('.js-select-boards')[0];
+ card.boardId = bSelect.options[bSelect.selectedIndex].value;
+ const textarea = $('#copy-card-title');
const titleEntry = textarea.val().trim();
// insert new card to the bottom of new list
- card.sort = Lists.findOne(this._id).cards().count();
+ card.sort = Lists.findOne(card.listId).cards().count();
if (titleEntry) {
const titleList = JSON.parse(titleEntry);
@@ -394,9 +404,16 @@ Template.copyChecklistToManyCardsPopup.events({
cursor.forEach(function() {
'use strict';
const checklist = arguments[0];
+ const checklistId = checklist._id;
checklist.cardId = _id;
checklist._id = null;
- Checklists.insert(checklist);
+ const newChecklistId = Checklists.insert(checklist);
+ ChecklistItems.find({checklistId}).forEach(function(item) {
+ item._id = null;
+ item.checklistId = newChecklistId;
+ item.cardId = _id;
+ ChecklistItems.insert(item);
+ });
});
// copy card comments
diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js
index 60dd6a34..4b6bf196 100644
--- a/client/components/lists/listHeader.js
+++ b/client/components/lists/listHeader.js
@@ -28,14 +28,15 @@ BlazeComponent.extendComponent({
},
showCardsCountForList(count) {
- return count > this.limitToShowCardsCount();
+ const limit = this.limitToShowCardsCount();
+ return limit > 0 && count > limit;
},
events() {
return [{
'click .js-open-list-menu': Popup.open('listAction'),
- 'click .js-add-card' () {
- const listDom = document.getElementById(`js-list-${this.currentData()._id}`);
+ 'click .js-add-card' (evt) {
+ const listDom = $(evt.target).parents(`#js-list-${this.currentData()._id}`)[0];
const listComponent = BlazeComponent.getComponentForElement(listDom);
listComponent.openForm({
position: 'top',
diff --git a/client/components/users/userHeader.jade b/client/components/users/userHeader.jade
index 096745ad..4ac59f45 100644
--- a/client/components/users/userHeader.jade
+++ b/client/components/users/userHeader.jade
@@ -86,5 +86,5 @@ template(name="changeSettingsPopup")
li
label.bold
| {{_ 'show-cards-minimum-count'}}
- input#show-cards-count-at.inline-input.left(type="number" value="#{showCardsCountAt}" min="1" max="99" onkeydown="return false")
+ input#show-cards-count-at.inline-input.left(type="number" value="#{showCardsCountAt}" min="0" max="99" onkeydown="return false")
input.js-apply-show-cards-at.left(type="submit" value="{{_ 'apply'}}")