summaryrefslogtreecommitdiffstats
path: root/client/components/cards/cardDetails.js
diff options
context:
space:
mode:
authorLiming Xie <liming.xie@gmail.com>2016-01-05 23:26:02 +0800
committerLiming Xie <liming.xie@gmail.com>2016-01-05 23:26:02 +0800
commit9bbdacc79a89667e0d6f1ed30c415e5350ad468b (patch)
treefc6d9918dcd77699295ecb5bdbaf59f9d7c2f479 /client/components/cards/cardDetails.js
parent9ef8ebaf09e52d7133ebe08ab1354ef663ee948b (diff)
downloadwekan-9bbdacc79a89667e0d6f1ed30c415e5350ad468b.tar.gz
wekan-9bbdacc79a89667e0d6f1ed30c415e5350ad468b.tar.bz2
wekan-9bbdacc79a89667e0d6f1ed30c415e5350ad468b.zip
Add notification, allow watch boards / lists / cards
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r--client/components/cards/cardDetails.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 2b04adad..d8323393 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -23,6 +23,11 @@ BlazeComponent.extendComponent({
this.calculateNextPeak();
},
+ isWatching() {
+ const card = this.currentData();
+ return card.findWatcher(Meteor.userId());
+ },
+
scrollParentContainer() {
const cardPanelWidth = 510;
const bodyBoardComponent = this.parentComponent();
@@ -128,6 +133,12 @@ BlazeComponent.extendComponent({
}
}).register('inlinedCardDescription');
+Template.cardDetailsActionsPopup.helpers({
+ isWatching() {
+ return this.findWatcher(Meteor.userId());
+ },
+});
+
Template.cardDetailsActionsPopup.events({
'click .js-members': Popup.open('cardMembers'),
'click .js-labels': Popup.open('cardLabels'),
@@ -139,6 +150,13 @@ Template.cardDetailsActionsPopup.events({
Popup.close();
},
'click .js-more': Popup.open('cardMore'),
+ 'click .js-toggle-watch-card'() {
+ const currentCard = this;
+ const level = currentCard.findWatcher(Meteor.userId()) ? null : 'watching';
+ Meteor.call('watch', 'card', currentCard._id, level, (err, ret) => {
+ if (!err && ret) Popup.close();
+ });
+ },
});
Template.editCardTitleForm.onRendered(function() {