diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-11-19 14:09:36 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-11-19 14:09:36 +0200 |
commit | 351d4767d7e93c90ac798769d6071da8730d834f (patch) | |
tree | 47b9e49342f17affce947c840566b9c03a630aab /client/components/lists | |
parent | f595120e7203fdeee1a6c899adb948807e84b672 (diff) | |
download | wekan-351d4767d7e93c90ac798769d6071da8730d834f.tar.gz wekan-351d4767d7e93c90ac798769d6071da8730d834f.tar.bz2 wekan-351d4767d7e93c90ac798769d6071da8730d834f.zip |
When logged in, use database for setting, so that changes are
immediate. Only on public board use cookies.
Comment out Collapse CSS that is not in use.
Thanks to xet7 !
Diffstat (limited to 'client/components/lists')
-rw-r--r-- | client/components/lists/list.js | 29 | ||||
-rw-r--r-- | client/components/lists/listHeader.js | 15 |
2 files changed, 33 insertions, 11 deletions
diff --git a/client/components/lists/list.js b/client/components/lists/list.js index 8433ad90..7a51fc6e 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -119,7 +119,19 @@ BlazeComponent.extendComponent({ const cookies = new Cookies(); this.autorun(() => { - if (!Utils.isMiniScreen() && cookies.has('showDesktopDragHandles')) { + let showDesktopDragHandles = false; + currentUser = Meteor.user(); + if (currentUser) { + showDesktopDragHandles = (currentUser.profile || {}).showDesktopDragHandles; + } else { + if (cookies.has('showDesktopDragHandles')) { + showDesktopDragHandles = true; + } else { + showDesktopDragHandles = false; + } + } + + if (!Utils.isMiniScreen() && showDesktopDragHandles) { $cards.sortable({ handle: '.handle', }); @@ -163,12 +175,17 @@ BlazeComponent.extendComponent({ Template.list.helpers({ showDesktopDragHandles() { - import { Cookies } from 'meteor/ostrio:cookies'; - const cookies = new Cookies(); - if (cookies.has('showDesktopDragHandles')) { - return true; + currentUser = Meteor.user(); + if (currentUser) { + return (currentUser.profile || {}).showDesktopDragHandles; } else { - return false; + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); + if (cookies.has('showDesktopDragHandles')) { + return true; + } else { + return false; + } } }, }); diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js index 90946610..4ef431fb 100644 --- a/client/components/lists/listHeader.js +++ b/client/components/lists/listHeader.js @@ -102,12 +102,17 @@ BlazeComponent.extendComponent({ Template.listHeader.helpers({ showDesktopDragHandles() { - import { Cookies } from 'meteor/ostrio:cookies'; - const cookies = new Cookies(); - if (cookies.has('showDesktopDragHandles')) { - return true; + currentUser = Meteor.user(); + if (currentUser) { + return (currentUser.profile || {}).showDesktopDragHandles; } else { - return false; + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); + if (cookies.has('showDesktopDragHandles')) { + return true; + } else { + return false; + } } }, }); |