diff --git a/client/components/main/header.css b/client/components/main/header.css index 0aacc4d65..adb00b310 100644 --- a/client/components/main/header.css +++ b/client/components/main/header.css @@ -107,6 +107,12 @@ #header-quick-access a { text-decoration: none; } +#header-quick-access i.fa { + color: #fff; +} +#header-quick-access i.fa:hover { + color: #ccc; +} #header-quick-access #header-user-bar, #header-quick-access #header-new-board-icon, #header-quick-access ul li { diff --git a/client/components/main/header.jade b/client/components/main/header.jade index 51409d044..394a482c7 100644 --- a/client/components/main/header.jade +++ b/client/components/main/header.jade @@ -6,6 +6,12 @@ template(name="header") The first link goes to the boards page. if currentUser #header-quick-access(class=currentBoard.colorClass) + a.js-toggle-desktop-drag-handles(title="{{_ 'show-desktop-drag-handles'}}" alt="{{_ 'show-desktop-drag-handles'}}") + i.fa.fa-arrows + if isShowDesktopDragHandles + i.fa.fa-check-square-o + unless isShowDesktopDragHandles + i.fa.fa-times if isMiniScreen span a(href="{{pathFor 'home'}}") diff --git a/client/components/main/header.js b/client/components/main/header.js index cf7464799..9131c110e 100644 --- a/client/components/main/header.js +++ b/client/components/main/header.js @@ -57,6 +57,19 @@ Template.header.events({ Session.set('currentList', this._id); Session.set('currentCard', null); }, + 'click .js-toggle-desktop-drag-handles'() { + //currentUser = Meteor.user(); + //if (currentUser) { + // Meteor.call('toggleDesktopDragHandles'); + //} else if (window.localStorage.getItem('showDesktopDragHandles')) { + if (window.localStorage.getItem('showDesktopDragHandles')) { + window.localStorage.removeItem('showDesktopDragHandles'); + location.reload(); + } else { + window.localStorage.setItem('showDesktopDragHandles', 'true'); + location.reload(); + } + }, }); Template.offlineWarning.events({ diff --git a/client/components/users/userHeader.jade b/client/components/users/userHeader.jade index 7b2414bf1..ae14b0dd9 100644 --- a/client/components/users/userHeader.jade +++ b/client/components/users/userHeader.jade @@ -159,12 +159,12 @@ template(name="changeSettingsPopup") // | {{_ 'hide-system-messages'}} // if hiddenSystemMessages // i.fa.fa-check - li - a.js-toggle-desktop-drag-handles - i.fa.fa-arrows - | {{_ 'show-desktop-drag-handles'}} - if isShowDesktopDragHandles - i.fa.fa-check + //li + // a.js-toggle-desktop-drag-handles + // i.fa.fa-arrows + // | {{_ 'show-desktop-drag-handles'}} + // if isShowDesktopDragHandles + // i.fa.fa-check unless currentUser.isWorker li label.bold.clear diff --git a/client/lib/utils.js b/client/lib/utils.js index c642639f0..6f5c3adf8 100644 --- a/client/lib/utils.js +++ b/client/lib/utils.js @@ -288,10 +288,11 @@ Utils = { // returns if desktop drag handles are enabled isShowDesktopDragHandles() { - const currentUser = Meteor.user(); - if (currentUser) { - return (currentUser.profile || {}).showDesktopDragHandles; - } else if (window.localStorage.getItem('showDesktopDragHandles')) { + //const currentUser = Meteor.user(); + //if (currentUser) { + // return (currentUser.profile || {}).showDesktopDragHandles; + //} else if (window.localStorage.getItem('showDesktopDragHandles')) { + if (window.localStorage.getItem('showDesktopDragHandles')) { return true; } else { return false; @@ -300,7 +301,8 @@ Utils = { // returns if mini screen or desktop drag handles isTouchScreenOrShowDesktopDragHandles() { - return this.isTouchScreen() || this.isShowDesktopDragHandles(); + //return this.isTouchScreen() || this.isShowDesktopDragHandles(); + return this.isShowDesktopDragHandles(); }, calculateIndexData(prevData, nextData, nItems = 1) {