diff options
author | Liming Xie <liming.xie@gmail.com> | 2016-01-05 23:26:02 +0800 |
---|---|---|
committer | Liming Xie <liming.xie@gmail.com> | 2016-01-05 23:26:02 +0800 |
commit | 9bbdacc79a89667e0d6f1ed30c415e5350ad468b (patch) | |
tree | fc6d9918dcd77699295ecb5bdbaf59f9d7c2f479 /client/components/boards/boardHeader.js | |
parent | 9ef8ebaf09e52d7133ebe08ab1354ef663ee948b (diff) | |
download | wekan-9bbdacc79a89667e0d6f1ed30c415e5350ad468b.tar.gz wekan-9bbdacc79a89667e0d6f1ed30c415e5350ad468b.tar.bz2 wekan-9bbdacc79a89667e0d6f1ed30c415e5350ad468b.zip |
Add notification, allow watch boards / lists / cards
Diffstat (limited to 'client/components/boards/boardHeader.js')
-rw-r--r-- | client/components/boards/boardHeader.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js index acf40f44..567f14ac 100644 --- a/client/components/boards/boardHeader.js +++ b/client/components/boards/boardHeader.js @@ -41,6 +41,11 @@ Template.boardChangeTitlePopup.events({ }); BlazeComponent.extendComponent({ + watchLevel() { + const currentBoard = Boards.findOne(Session.get('currentBoard')); + return currentBoard.getWatchLevel(Meteor.userId()); + }, + isStarred() { const boardId = Session.get('currentBoard'); const user = Meteor.user(); @@ -65,6 +70,7 @@ BlazeComponent.extendComponent({ }, 'click .js-open-board-menu': Popup.open('boardMenu'), 'click .js-change-visibility': Popup.open('boardChangeVisibility'), + 'click .js-watch-board': Popup.open('boardChangeWatch'), 'click .js-open-filter-view'() { Sidebar.setView('filter'); }, @@ -176,3 +182,25 @@ BlazeComponent.extendComponent({ }]; }, }).register('boardChangeVisibilityPopup'); + +BlazeComponent.extendComponent({ + watchLevel() { + const currentBoard = Boards.findOne(Session.get('currentBoard')); + return currentBoard.getWatchLevel(Meteor.userId()); + }, + + watchCheck() { + return this.currentData() === this.watchLevel(); + }, + + events() { + return [{ + 'click .js-select-watch'() { + const level = this.currentData(); + Meteor.call('watch', 'board', Session.get('currentBoard'), level, (err, ret) => { + if (!err && ret) Popup.close(); + }); + }, + }]; + }, +}).register('boardChangeWatchPopup'); |