Fix move to top

If the minOrder is 0, the previous code does not work. This code is now
doing the obvious stuff to change the order.
This commit is contained in:
Alexander Sulfrian 2016-05-19 21:24:21 +02:00 committed by Maxime Quandalle
parent 35c6b51a3f
commit 81a35be856
No known key found for this signature in database
GPG key ID: 428641C03D29CA10

View file

@ -147,12 +147,12 @@ Template.cardDetailsActionsPopup.events({
'click .js-move-card-to-top'(evt) {
evt.preventDefault();
const minOrder = _.min(this.list().cards().map((c) => c.sort));
this.move(this.listId, minOrder / 2);
this.move(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, Math.floor(maxOrder) + 1);
this.move(this.listId, maxOrder + 1);
},
'click .js-archive'(evt) {
evt.preventDefault();