From 81a35be8562cb6c28848afc2cb24ae9ec145ce47 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 19 May 2016 21:24:21 +0200 Subject: 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. --- client/components/cards/cardDetails.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/components/cards') diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 299bbf34..5dd0b762 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -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(); -- cgit v1.2.3-1-g7c22