Browse Source

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.
Alexander Sulfrian 9 years ago
parent
commit
81a35be856
1 changed files with 2 additions and 2 deletions
  1. 2 2
      client/components/cards/cardDetails.js

+ 2 - 2
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();