Move card to top/bottom using now the same internal code logic

This commit is contained in:
Martin Filser 2022-02-08 22:25:11 +01:00
parent dcff70c983
commit 6b6bdddce6

View file

@ -679,21 +679,13 @@ Template.cardDetailsActionsPopup.events({
'click .js-set-card-color': Popup.open('setCardColor'),
'click .js-move-card-to-top'(event) {
event.preventDefault();
const minOrder = _.min(
this.list()
.cardsUnfiltered(this.swimlaneId)
.map((c) => c.sort),
);
const minOrder = this.getMinSort();
this.move(this.boardId, this.swimlaneId, this.listId, minOrder - 1);
Popup.back();
},
'click .js-move-card-to-bottom'(event) {
event.preventDefault();
const maxOrder = _.max(
this.list()
.cardsUnfiltered(this.swimlaneId)
.map((c) => c.sort),
);
const maxOrder = this.getMaxSort();
this.move(this.boardId, this.swimlaneId, this.listId, maxOrder + 1);
Popup.back();
},