|
|
|
@ -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(); |
|
|
|
|
} |
|
|
|
|
}]; |
|
|
|
|