mirror of
https://github.com/wekan/wekan.git
synced 2026-01-04 08:38:49 +01:00
parent
f03fee5162
commit
9bea6a52d3
5 changed files with 17 additions and 28 deletions
|
|
@ -9,25 +9,17 @@ BlazeComponent.extendComponent({
|
|||
});
|
||||
},
|
||||
|
||||
starredBoards: function() {
|
||||
var cursor = Boards.find({
|
||||
_id: { $in: Meteor.user().profile.starredBoards || [] }
|
||||
}, {
|
||||
sort: ['title']
|
||||
});
|
||||
return cursor.count() === 0 ? null : cursor;
|
||||
},
|
||||
|
||||
isStarred: function() {
|
||||
var user = Meteor.user();
|
||||
return user && user.hasStarred(this._id);
|
||||
return user && user.hasStarred(this.currentData()._id);
|
||||
},
|
||||
|
||||
events: function() {
|
||||
return [{
|
||||
'click .js-add-board': Popup.open('createBoard'),
|
||||
'click .js-star-board': function(evt) {
|
||||
Meteor.user().toggleBoardStar(this._id);
|
||||
var boardId = this.currentData()._id;
|
||||
Meteor.user().toggleBoardStar(boardId);
|
||||
evt.preventDefault();
|
||||
}
|
||||
}];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue