summaryrefslogtreecommitdiffstats
path: root/models/users.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-09-19 01:12:04 +0300
committerLauri Ojansivu <x@xet7.org>2019-09-19 01:12:04 +0300
commit55a2473d813c6e6687de393bda1ccc0c21f9ebcc (patch)
tree4cd96ee0c363153c6733454b91dea3185a11e76d /models/users.js
parentba754cfaea9a467e18b2b4b4bcbaafaaac442677 (diff)
parent03d7fc02ecc90690e1282d417f35b7e4561af066 (diff)
downloadwekan-55a2473d813c6e6687de393bda1ccc0c21f9ebcc.tar.gz
wekan-55a2473d813c6e6687de393bda1ccc0c21f9ebcc.tar.bz2
wekan-55a2473d813c6e6687de393bda1ccc0c21f9ebcc.zip
Merge branch 'feature-drag-handle'
Diffstat (limited to 'models/users.js')
-rw-r--r--models/users.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/models/users.js b/models/users.js
index ee53c7ab..ded864e5 100644
--- a/models/users.js
+++ b/models/users.js
@@ -109,6 +109,13 @@ Users.attachSchema(
type: String,
optional: true,
},
+ 'profile.showDesktopDragHandles': {
+ /**
+ * does the user want to hide system messages?
+ */
+ type: Boolean,
+ optional: true,
+ },
'profile.hiddenSystemMessages': {
/**
* does the user want to hide system messages?
@@ -368,6 +375,11 @@ Users.helpers({
return _.contains(notifications, activityId);
},
+ hasShowDesktopDragHandles() {
+ const profile = this.profile || {};
+ return profile.showDesktopDragHandles || false;
+ },
+
hasHiddenSystemMessages() {
const profile = this.profile || {};
return profile.hiddenSystemMessages || false;
@@ -473,6 +485,14 @@ Users.mutations({
else this.addTag(tag);
},
+ toggleDesktopHandles(value = false) {
+ return {
+ $set: {
+ 'profile.showDesktopDragHandles': !value,
+ },
+ };
+ },
+
toggleSystem(value = false) {
return {
$set: {
@@ -548,6 +568,10 @@ Meteor.methods({
Users.update(userId, { $set: { username } });
}
},
+ toggleDesktopDragHandles() {
+ const user = Meteor.user();
+ user.toggleDesktopHandles(user.hasShowDesktopDragHandles());
+ },
toggleSystemMessages() {
const user = Meteor.user();
user.toggleSystem(user.hasHiddenSystemMessages());