summaryrefslogtreecommitdiffstats
path: root/models/swimlanes.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/swimlanes.js')
-rw-r--r--models/swimlanes.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/models/swimlanes.js b/models/swimlanes.js
index 46e410da..4cd35574 100644
--- a/models/swimlanes.js
+++ b/models/swimlanes.js
@@ -174,6 +174,21 @@ Swimlanes.helpers({
},
lists() {
+ const enabled = Meteor.user().hasShowDesktopDragHandles();
+ return enabled ? this.draggableLists() : this.newestLists();
+ },
+ newestLists() {
+ // sorted lists from newest to the oldest, by its creation date or its cards' last modification date
+ return Lists.find(
+ {
+ boardId: this.boardId,
+ swimlaneId: { $in: [this._id, ''] },
+ archived: false,
+ },
+ { sort: { updatedAt: -1 } },
+ );
+ },
+ draggableLists() {
return Lists.find(
{
boardId: this.boardId,