summaryrefslogtreecommitdiffstats
path: root/client/components/lists
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/lists')
-rw-r--r--client/components/lists/list.styl4
-rw-r--r--client/components/lists/listHeader.jade5
-rw-r--r--client/components/lists/listHeader.js18
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();