diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-01-22 10:35:09 +0100 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-01-22 11:10:29 +0100 |
commit | 3368ebf067779d1f306a2447e2357e34213f0126 (patch) | |
tree | 72d8eb8a69b13a3672c7d1492234cbc39ce4fed3 /client/components/cards/cardDetails.js | |
parent | b0ac10d94a8200a1ad0199a82c3f9d9be7ac9882 (diff) | |
download | wekan-3368ebf067779d1f306a2447e2357e34213f0126.tar.gz wekan-3368ebf067779d1f306a2447e2357e34213f0126.tar.bz2 wekan-3368ebf067779d1f306a2447e2357e34213f0126.zip |
color: add option in hamburger to change the card color
Currently only dropdown, no palette
Fixes: #428
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r-- | client/components/cards/cardDetails.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 060ded5a..7883f129 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -338,6 +338,7 @@ Template.cardDetailsActionsPopup.events({ 'click .js-move-card': Popup.open('moveCard'), 'click .js-copy-card': Popup.open('copyCard'), 'click .js-copy-checklist-cards': Popup.open('copyChecklistToManyCards'), + 'click .js-set-card-color': Popup.open('setCardColor'), 'click .js-move-card-to-top' (evt) { evt.preventDefault(); const minOrder = _.min(this.list().cards(this.swimlaneId).map((c) => c.sort)); @@ -584,6 +585,18 @@ Template.copyChecklistToManyCardsPopup.events({ }, }); +Template.setCardColorPopup.events({ + 'click .js-submit' () { + // XXX We should *not* get the currentCard from the global state, but + // instead from a “component” state. + const card = Cards.findOne(Session.get('currentCard')); + const colorSelect = $('.js-select-colors')[0]; + newColor = colorSelect.options[colorSelect.selectedIndex].value; + card.setColor(newColor); + Popup.close(); + }, +}); + BlazeComponent.extendComponent({ onCreated() { this.currentCard = this.currentData(); |