summaryrefslogtreecommitdiffstats
path: root/models/users.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-09-17 01:39:10 +0300
committerLauri Ojansivu <x@xet7.org>2019-09-17 01:39:10 +0300
commit03d7fc02ecc90690e1282d417f35b7e4561af066 (patch)
treefa11364240de3a1370d034dd9202413f471a6f48 /models/users.js
parentddd00a27a97b047ca854ece80d8bc60021784f3f (diff)
downloadwekan-03d7fc02ecc90690e1282d417f35b7e4561af066.tar.gz
wekan-03d7fc02ecc90690e1282d417f35b7e4561af066.tar.bz2
wekan-03d7fc02ecc90690e1282d417f35b7e4561af066.zip
Drag handles. In Progress.
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());