summaryrefslogtreecommitdiffstats
path: root/client/components/cards/cardDetails.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-01-22 13:02:14 +0200
committerGitHub <noreply@github.com>2019-01-22 13:02:14 +0200
commit0c5052ebaee74d6357634e28919ff81c52a0a0e8 (patch)
tree09342c3b76d839c9836d72ae0fb9f0559c2fe9d3 /client/components/cards/cardDetails.js
parentd3b2ae1975a72b3be816538059d9c3dc6684a59d (diff)
parentf4f0f489ebf9e23dc8150d5a94239484256b0beb (diff)
downloadwekan-0c5052ebaee74d6357634e28919ff81c52a0a0e8.tar.gz
wekan-0c5052ebaee74d6357634e28919ff81c52a0a0e8.tar.bz2
wekan-0c5052ebaee74d6357634e28919ff81c52a0a0e8.zip
Merge pull request #2116 from bentiss/color
Add per card color
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r--client/components/cards/cardDetails.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index e17e7467..7883f129 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -22,6 +22,7 @@ BlazeComponent.extendComponent({
onCreated() {
this.currentBoard = Boards.findOne(Session.get('currentBoard'));
this.isLoaded = new ReactiveVar(false);
+ this.currentColor = new ReactiveVar(this.data().color);
const boardBody = this.parentComponent().parentComponent();
//in Miniview parent is Board, not BoardBody.
if (boardBody !== null) {
@@ -337,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));
@@ -583,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();