mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 09:20:12 +01:00
Fixed card move to top/bottom
This commit is contained in:
parent
80e06b8ffc
commit
99d38f2d61
2 changed files with 13 additions and 2 deletions
|
|
@ -86,6 +86,17 @@ Lists.helpers({
|
||||||
{ sort: ['sort'] });
|
{ sort: ['sort'] });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cardsUnfiltered(swimlaneId) {
|
||||||
|
const selector = {
|
||||||
|
listId: this._id,
|
||||||
|
archived: false,
|
||||||
|
};
|
||||||
|
if (swimlaneId)
|
||||||
|
selector.swimlaneId = swimlaneId;
|
||||||
|
return Cards.find(selector,
|
||||||
|
{ sort: ['sort'] });
|
||||||
|
},
|
||||||
|
|
||||||
allCards() {
|
allCards() {
|
||||||
return Cards.find({ listId: this._id });
|
return Cards.find({ listId: this._id });
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ RulesHelper = {
|
||||||
list = Lists.findOne({title: action.listTitle, boardId });
|
list = Lists.findOne({title: action.listTitle, boardId });
|
||||||
listId = list._id;
|
listId = list._id;
|
||||||
}
|
}
|
||||||
const minOrder = _.min(list.cards(card.swimlaneId).map((c) => c.sort));
|
const minOrder = _.min(list.cardsUnfiltered(card.swimlaneId).map((c) => c.sort));
|
||||||
card.move(card.swimlaneId, listId, minOrder - 1);
|
card.move(card.swimlaneId, listId, minOrder - 1);
|
||||||
}
|
}
|
||||||
if(action.actionType === 'moveCardToBottom'){
|
if(action.actionType === 'moveCardToBottom'){
|
||||||
|
|
@ -56,7 +56,7 @@ RulesHelper = {
|
||||||
list = Lists.findOne({title: action.listTitle, boardId});
|
list = Lists.findOne({title: action.listTitle, boardId});
|
||||||
listId = list._id;
|
listId = list._id;
|
||||||
}
|
}
|
||||||
const maxOrder = _.max(list.cards(card.swimlaneId).map((c) => c.sort));
|
const maxOrder = _.max(list.cardsUnfiltered(card.swimlaneId).map((c) => c.sort));
|
||||||
card.move(card.swimlaneId, listId, maxOrder + 1);
|
card.move(card.swimlaneId, listId, maxOrder + 1);
|
||||||
}
|
}
|
||||||
if(action.actionType === 'sendEmail'){
|
if(action.actionType === 'sendEmail'){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue