summaryrefslogtreecommitdiffstats
path: root/models/boards.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/boards.js')
-rw-r--r--models/boards.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js
index a9348478..c7f93022 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -409,6 +409,21 @@ Boards.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._id,
+ archived: false,
+ },
+ { sort: { updatedAt: -1 } },
+ );
+ },
+ draggableLists() {
return Lists.find({ boardId: this._id }, { sort: { sort: 1 } });
},