summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-02-07 01:18:08 -0300
committerAndrés Manelli <andresmanelli@gmail.com>2018-02-07 01:24:15 -0300
commitfcebb2a5373d6dea41b98b530c176cbee31bee4b (patch)
tree495b275bae22d18b458857a085dc01ba53a1e58e
parent79ae90825e155a772124938ed12dd5e373e05f95 (diff)
downloadwekan-fcebb2a5373d6dea41b98b530c176cbee31bee4b.tar.gz
wekan-fcebb2a5373d6dea41b98b530c176cbee31bee4b.tar.bz2
wekan-fcebb2a5373d6dea41b98b530c176cbee31bee4b.zip
Fix move parameters
-rw-r--r--client/components/cards/cardDetails.js10
-rw-r--r--models/cards.js5
2 files changed, 7 insertions, 8 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 94a938f0..d70167ce 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -172,13 +172,13 @@ Template.cardDetailsActionsPopup.events({
'click .js-copy-card': Popup.open('copyCard'),
'click .js-move-card-to-top' (evt) {
evt.preventDefault();
- const minOrder = _.min(this.list().cards().map((c) => c.sort));
- this.move(this.listId, minOrder - 1);
+ const minOrder = _.min(this.list().cards(this.swimlaneId).map((c) => c.sort));
+ this.move(this.swimlaneId, this.listId, minOrder - 1);
},
'click .js-move-card-to-bottom' (evt) {
evt.preventDefault();
- const maxOrder = _.max(this.list().cards().map((c) => c.sort));
- this.move(this.listId, maxOrder + 1);
+ const maxOrder = _.max(this.list().cards(this.swimlaneId).map((c) => c.sort));
+ this.move(this.swimlaneId, this.listId, maxOrder + 1);
},
'click .js-archive' (evt) {
evt.preventDefault();
@@ -215,7 +215,7 @@ Template.moveCardPopup.events({
// instead from a “component” state.
const card = Cards.findOne(Session.get('currentCard'));
const newListId = this._id;
- card.move(newListId);
+ card.move(card.swimlaneId, newListId, 0);
Popup.close();
},
});
diff --git a/models/cards.js b/models/cards.js
index d175a430..43e7d843 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -225,10 +225,9 @@ Cards.mutations({
swimlaneId,
listId,
boardId: list.boardId,
+ sort: sortIndex,
};
- if (sortIndex) {
- mutatedFields.sort = sortIndex;
- }
+
return {$set: mutatedFields};
},