Card Details, move card between lists moves now the card to the top by default

- mostly the card is sorted anywhere and you have to scroll the list,
  now, the card is always at the top
This commit is contained in:
Martin Filser 2022-02-08 22:14:01 +01:00
parent 947692693c
commit ad5167de55
2 changed files with 53 additions and 2 deletions

View file

@ -388,7 +388,9 @@ BlazeComponent.extendComponent({
let card = this.data();
const listSelect = this.$('.js-select-card-details-lists')[0];
const listId = listSelect.options[listSelect.selectedIndex].value;
card.move(card.boardId, card.swimlaneId, listId, card.sort);
const minOrder = card.getMinSort(listId, card.swimlaneId);
card.move(card.boardId, card.swimlaneId, listId, minOrder - 1);
},
'click .js-go-to-linked-card'() {
Utils.goCardId(this.data().linkedId);
@ -836,7 +838,9 @@ Template.moveCardPopup.events({
const listId = lSelect.options[lSelect.selectedIndex].value;
const slSelect = $('.js-select-swimlanes')[0];
const swimlaneId = slSelect.options[slSelect.selectedIndex].value;
card.move(boardId, swimlaneId, listId, 0);
const minOrder = card.getMinSort(listId, swimlaneId);
card.move(boardId, swimlaneId, listId, minOrder - 1);
// set new id's to card object in case the card is moved to top by the comment "moveCard" after this command (.js-move-card)
this.boardId = boardId;