summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authornztqa <nztqa@users.noreply.github.com>2017-09-25 20:27:54 +0900
committernztqa <nztqa@users.noreply.github.com>2017-09-25 20:27:54 +0900
commit61ee107c27ea4b5be3b8b9bcb6d6a36de65dfcd1 (patch)
treef530b4a5c3f8bf657e5d071d90e198d421514407 /client/components
parentb503ba1144454234c3b9f852aefcde6e4a262a63 (diff)
downloadwekan-61ee107c27ea4b5be3b8b9bcb6d6a36de65dfcd1.tar.gz
wekan-61ee107c27ea4b5be3b8b9bcb6d6a36de65dfcd1.tar.bz2
wekan-61ee107c27ea4b5be3b8b9bcb6d6a36de65dfcd1.zip
Disable button when "Hide system messages" in user profile setting is valid
Diffstat (limited to 'client/components')
-rw-r--r--client/components/cards/cardDetails.jade5
-rw-r--r--client/components/cards/cardDetails.js5
-rw-r--r--client/components/forms/forms.styl5
-rw-r--r--client/components/lists/listBody.js4
4 files changed, 15 insertions, 4 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index 3a144557..60b20a8a 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -89,7 +89,10 @@ template(name="cardDetails")
h2 {{ _ 'activity'}}
.material-toggle-switch
span.toggle-switch-title {{_ 'hide-system-messages'}}
- input.toggle-switch(type="checkbox" id="toggleButton")
+ if hiddenSystemMessages
+ input.toggle-switch(type="checkbox" id="toggleButton" checked="checked" disabled)
+ else
+ input.toggle-switch(type="checkbox" id="toggleButton")
label.toggle-label(for="toggleButton")
if currentUser.isBoardMember
+commentForm
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index d622c912..ed23b359 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -28,6 +28,11 @@ BlazeComponent.extendComponent({
return card.findWatcher(Meteor.userId());
},
+ hiddenSystemMessages() {
+ console.log('doo:', Meteor.user().hasHiddenSystemMessages());
+ return Meteor.user().hasHiddenSystemMessages();
+ },
+
canModifyCard() {
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
},
diff --git a/client/components/forms/forms.styl b/client/components/forms/forms.styl
index 4c8ff7b0..1947c11d 100644
--- a/client/components/forms/forms.styl
+++ b/client/components/forms/forms.styl
@@ -668,11 +668,11 @@ button
left: 20px
background-color: #179588
-.toggle-switch:disabled ~ .toggle-label
+.toggle-switch:checked:disabled ~ .toggle-label
background-color: #d5d5d5
pointer-events: none
- &after
+ &:after
background-color: #bcbdbc
.toggle-switch
@@ -682,6 +682,7 @@ button
margin: 0 0.5em
display: flex
+
@media screen and (max-width: 800px)
.edit-controls,
.add-controls
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index 011c92c8..794f33c2 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -84,7 +84,9 @@ BlazeComponent.extendComponent({
evt.preventDefault();
Utils.goBoardId(Session.get('currentBoard'));
} else {
- $('.toggle-switch').prop('checked', false);
+ if (!Meteor.user().hasHiddenSystemMessages()) {
+ $('.toggle-switch').prop('checked', false);
+ }
}
},