diff options
Diffstat (limited to 'client/components/cards')
-rw-r--r-- | client/components/cards/cardDetails.jade | 4 | ||||
-rw-r--r-- | client/components/cards/cardDetails.js | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index 2ca032ef..734fc7e3 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -93,6 +93,10 @@ template(name="cardDetailsActionsPopup") li: a.js-attachments {{_ 'card-edit-attachments'}} hr ul.pop-over-list + li: a.js-move-card-to-top {{_ 'moveCardToTop-title'}} + li: a.js-move-card-to-bottom {{_ 'moveCardToBottom-title'}} + hr + ul.pop-over-list li: a.js-move-card {{_ 'moveCardPopup-title'}} unless archived li: a.js-archive {{_ 'archive-card'}} diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 08a465bd..299bbf34 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -144,6 +144,16 @@ Template.cardDetailsActionsPopup.events({ 'click .js-labels': Popup.open('cardLabels'), 'click .js-attachments': Popup.open('cardAttachments'), 'click .js-move-card': Popup.open('moveCard'), + '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); + }, + '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); + }, 'click .js-archive'(evt) { evt.preventDefault(); this.archive(); |