mirror of
https://github.com/wekan/wekan.git
synced 2026-02-18 05:58:07 +01:00
Merge branch 'add-toggle-watch-icon-on-card' of github.com:Rayene123/wekan into Rayene123-add-toggle-watch-icon-on-card
This commit is contained in:
commit
bc2eab6f9d
3 changed files with 54 additions and 24 deletions
|
|
@ -225,3 +225,12 @@ template(name="minicardDetailsActionsPopup")
|
|||
a.js-link
|
||||
i.fa.fa-link
|
||||
| {{_ 'link-card'}}
|
||||
li
|
||||
a.js-toggle-watch-card
|
||||
if isWatching
|
||||
i.fa.fa-eye
|
||||
| {{_ 'unwatch'}}
|
||||
else
|
||||
i.fa.fa-eye-slash
|
||||
| {{_ 'watch'}}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
return ret;
|
||||
},
|
||||
isWatching() {
|
||||
const card = this.currentData();
|
||||
return card.findWatcher(Meteor.userId());
|
||||
},
|
||||
|
||||
showMembers() {
|
||||
// cache "board" to reduce the mini-mongodb access
|
||||
|
|
@ -125,6 +129,9 @@ Template.minicard.helpers({
|
|||
? Meteor.connection._lastSessionId
|
||||
: null;
|
||||
},
|
||||
isWatching() {
|
||||
return this.findWatcher(Meteor.userId());
|
||||
}
|
||||
});
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
|
|
@ -178,4 +185,11 @@ Template.minicardDetailsActionsPopup.events({
|
|||
this.archive();
|
||||
Utils.goBoardId(this.boardId);
|
||||
}),
|
||||
'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.back();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue