diff options
author | Friedrich von Never <friedrich@fornever.me> | 2016-03-19 10:40:23 +0600 |
---|---|---|
committer | Friedrich von Never <friedrich@fornever.me> | 2016-03-19 10:40:23 +0600 |
commit | cfbc8eed68e46a4ee8f28ff085242c200febe1d0 (patch) | |
tree | 771d191cad93f776ac7e7891b7f5c9b5d2ed1981 /client/components/cards | |
parent | b8aefedcc3dcaf62d1b45f1e4ffb1dc4fdc55f63 (diff) | |
download | wekan-cfbc8eed68e46a4ee8f28ff085242c200febe1d0.tar.gz wekan-cfbc8eed68e46a4ee8f28ff085242c200febe1d0.tar.bz2 wekan-cfbc8eed68e46a4ee8f28ff085242c200febe1d0.zip |
cardDetails: allow to move cards to top / bottom
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(); |