blob: cf6b727c147379c1523341fda25a14cc25ebfb44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
BlazeComponent.extendComponent({
template: function() {
return 'boardList';
},
boards: function() {
return Boards.find({ archived: false }, {
sort: ['title']
});
},
isStarred: function() {
var user = Meteor.user();
return user && user.hasStarred(this.currentData()._id);
},
events: function() {
return [{
'click .js-add-board': Popup.open('createBoard'),
'click .js-star-board': function(evt) {
var boardId = this.currentData()._id;
Meteor.user().toggleBoardStar(boardId);
evt.preventDefault();
}
}];
}
}).register('boardList');
|