diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-06-08 19:12:17 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2020-06-08 19:12:17 +0300 |
commit | 39519d1cc944c567837be0f88ab4a037e2144c61 (patch) | |
tree | 080f635f9cd7aadb15e82ae609fc8f0b5647c51b /client | |
parent | dcbf92b5b18426078facdb0d983c4747f73ee2d4 (diff) | |
download | wekan-39519d1cc944c567837be0f88ab4a037e2144c61.tar.gz wekan-39519d1cc944c567837be0f88ab4a037e2144c61.tar.bz2 wekan-39519d1cc944c567837be0f88ab4a037e2144c61.zip |
1) Public board default view to Swimlane.
2) When changing Public board view (sets view cookie), also reload page so view is changed immediately.
Thanks to xet7 !
Diffstat (limited to 'client')
-rw-r--r-- | client/components/boards/boardHeader.jade | 4 | ||||
-rw-r--r-- | client/lib/utils.js | 18 |
2 files changed, 15 insertions, 7 deletions
diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade index 53346db4..1daf0618 100644 --- a/client/components/boards/boardHeader.jade +++ b/client/components/boards/boardHeader.jade @@ -99,10 +99,10 @@ template(name="boardHeaderBar") a.board-header-btn.js-toggle-board-view( title="{{_ 'board-view'}}") i.fa.fa-caret-down - if $eq boardView 'board-view-lists' - i.fa.fa-trello if $eq boardView 'board-view-swimlanes' i.fa.fa-th-large + if $eq boardView 'board-view-lists' + i.fa.fa-trello if $eq boardView 'board-view-cal' i.fa.fa-calendar span {{#if boardView}}{{_ boardView}}{{else}}{{_ 'board-view-swimlanes'}}{{/if}} diff --git a/client/lib/utils.js b/client/lib/utils.js index c921fddc..754214c0 100644 --- a/client/lib/utils.js +++ b/client/lib/utils.js @@ -6,12 +6,18 @@ Utils = { currentUser = Meteor.user(); if (currentUser) { Meteor.user().setBoardView(view); - } else if (view === 'board-view-lists') { - cookies.set('boardView', 'board-view-lists'); //true } else if (view === 'board-view-swimlanes') { cookies.set('boardView', 'board-view-swimlanes'); //true + location.reload(); + } else if (view === 'board-view-lists') { + cookies.set('boardView', 'board-view-lists'); //true + location.reload(); } else if (view === 'board-view-cal') { cookies.set('boardView', 'board-view-cal'); //true + location.reload(); + } else { + cookies.set('boardView', 'board-view-swimlanes'); //true + location.reload(); } }, @@ -24,14 +30,16 @@ Utils = { currentUser = Meteor.user(); if (currentUser) { return (currentUser.profile || {}).boardView; - } else if (cookies.get('boardView') === 'board-view-lists') { - return 'board-view-lists'; } else if (cookies.get('boardView') === 'board-view-swimlanes') { return 'board-view-swimlanes'; + } else if (cookies.get('boardView') === 'board-view-lists') { + return 'board-view-lists'; } else if (cookies.get('boardView') === 'board-view-cal') { return 'board-view-cal'; } else { - return false; + cookies.set('boardView', 'board-view-swimlanes'); //true + location.reload(); + return 'board-view-swimlanes'; } }, |