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/lists | |
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/lists')
-rw-r--r-- | client/components/lists/list.styl | 4 | ||||
-rw-r--r-- | client/components/lists/listHeader.jade | 5 | ||||
-rw-r--r-- | client/components/lists/listHeader.js | 18 |
3 files changed, 27 insertions, 0 deletions
diff --git a/client/components/lists/list.styl b/client/components/lists/list.styl index 1848459c..cf939a6e 100644 --- a/client/components/lists/list.styl +++ b/client/components/lists/list.styl @@ -65,6 +65,10 @@ text-overflow: ellipsis word-wrap: break-word + .list-header-watch-icon + padding-left: 10px + color: #a6a6a6 + .list-header-menu-icon position: absolute padding: 7px diff --git a/client/components/lists/listHeader.jade b/client/components/lists/listHeader.jade index 34824085..f9fe065f 100644 --- a/client/components/lists/listHeader.jade +++ b/client/components/lists/listHeader.jade @@ -7,6 +7,8 @@ template(name="listHeader") class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}") = title if currentUser.isBoardMember + if isWatching + i.list-header-watch-icon.fa.fa-eye a.list-header-menu-icon.fa.fa-navicon.js-open-list-menu template(name="editListTitleForm") @@ -18,6 +20,9 @@ template(name="editListTitleForm") template(name="listActionPopup") ul.pop-over-list + li: a.js-toggle-watch-list {{#if isWatching}}{{_ 'unwatch'}}{{else}}{{_ 'watch'}}{{/if}} + hr + ul.pop-over-list li: a.js-add-card {{_ 'add-card'}} if cards.count li: a.js-select-cards {{_ 'list-select-cards'}} diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js index c9eaee12..c7ae8e62 100644 --- a/client/components/lists/listHeader.js +++ b/client/components/lists/listHeader.js @@ -8,6 +8,11 @@ BlazeComponent.extendComponent({ } }, + isWatching() { + const list = this.currentData(); + return list.findWatcher(Meteor.userId()); + }, + events() { return [{ 'click .js-open-list-menu': Popup.open('listAction'), @@ -16,6 +21,12 @@ BlazeComponent.extendComponent({ }, }).register('listHeader'); +Template.listActionPopup.helpers({ + isWatching() { + return this.findWatcher(Meteor.userId()); + }, +}); + Template.listActionPopup.events({ 'click .js-add-card'() { const listDom = document.getElementById(`js-list-${this._id}`); @@ -29,6 +40,13 @@ Template.listActionPopup.events({ MultiSelection.add(cardIds); Popup.close(); }, + 'click .js-toggle-watch-list'() { + const currentList = this; + const level = currentList.findWatcher(Meteor.userId()) ? null : 'watching'; + Meteor.call('watch', 'list', currentList._id, level, (err, ret) => { + if (!err && ret) Popup.close(); + }); + }, 'click .js-close-list'(evt) { evt.preventDefault(); this.archive(); |