Add notification, allow watch boards / lists / cards

This commit is contained in:
Liming Xie 2016-01-05 23:26:02 +08:00
parent 9ef8ebaf09
commit 9bbdacc79a
24 changed files with 579 additions and 16 deletions

View file

@ -8,6 +8,11 @@ BlazeComponent.extendComponent({
}
},
isWatching() {
const list = this.currentData();
return list.findWatcher(Meteor.userId());
},
events() {
return [{
'click .js-open-list-menu': Popup.open('listAction'),
@ -16,6 +21,12 @@ BlazeComponent.extendComponent({
},
}).register('listHeader');
Template.listActionPopup.helpers({
isWatching() {
return this.findWatcher(Meteor.userId());
},
});
Template.listActionPopup.events({
'click .js-add-card'() {
const listDom = document.getElementById(`js-list-${this._id}`);
@ -29,6 +40,13 @@ Template.listActionPopup.events({
MultiSelection.add(cardIds);
Popup.close();
},
'click .js-toggle-watch-list'() {
const currentList = this;
const level = currentList.findWatcher(Meteor.userId()) ? null : 'watching';
Meteor.call('watch', 'list', currentList._id, level, (err, ret) => {
if (!err && ret) Popup.close();
});
},
'click .js-close-list'(evt) {
evt.preventDefault();
this.archive();