wekan/client/components/boards/boardsList.js

31 lines
675 B
JavaScript
Raw Normal View History

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();
2015-08-23 22:00:02 +02:00
return user && user.hasStarred(this.currentData()._id);
},
events: function() {
return [{
'click .js-add-board': Popup.open('createBoard'),
'click .js-star-board': function(evt) {
2015-08-23 22:00:02 +02:00
var boardId = this.currentData()._id;
Meteor.user().toggleBoardStar(boardId);
evt.preventDefault();
}
}];
}
}).register('boardList');