wekan/client/components/boards/boardList.js
2015-08-27 01:26:21 +02:00

30 lines
675 B
JavaScript

BlazeComponent.extendComponent({
template: function() {
return 'boardList';
},
boards: function() {
return Boards.find({
archived: false,
'members.userId': Meteor.userId()
}, {
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');