diff options
Diffstat (limited to 'client/components/boards/boardsList.js')
-rw-r--r-- | client/components/boards/boardsList.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js new file mode 100644 index 00000000..2311e7d0 --- /dev/null +++ b/client/components/boards/boardsList.js @@ -0,0 +1,30 @@ +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'); |