Copy card is now at the top too (same as move card)

This commit is contained in:
Martin Filser 2022-02-08 22:20:21 +01:00
parent ad5167de55
commit dcff70c983

View file

@ -968,8 +968,10 @@ Template.copyCardPopup.events({
const boardId = bSelect.options[bSelect.selectedIndex].value;
const textarea = $('#copy-card-title');
const title = textarea.val().trim();
// insert new card to the bottom of new list
card.sort = Lists.findOne(card.listId).cards().count();
// insert new card to the top of new list
const minOrder = card.getMinSort(listId, swimlaneId);
card.sort = minOrder - 1;
if (title) {
card.title = title;