diff options
author | Sam X. Chen <sam.xi.chen@gmail.com> | 2019-10-10 22:57:40 -0400 |
---|---|---|
committer | Sam X. Chen <sam.xi.chen@gmail.com> | 2019-10-10 22:57:40 -0400 |
commit | 77f8b76d4e13c35ea3451622176bbb69a4d39a32 (patch) | |
tree | 259728686df72cd8747d112cb1907f7ab102899e /models/swimlanes.js | |
parent | e60926f8471c05f50877f46568554e7b2f24815a (diff) | |
download | wekan-77f8b76d4e13c35ea3451622176bbb69a4d39a32.tar.gz wekan-77f8b76d4e13c35ea3451622176bbb69a4d39a32.tar.bz2 wekan-77f8b76d4e13c35ea3451622176bbb69a4d39a32.zip |
Add Features: allowing lists to be sorted by modifiedAt when not in draggable mode
Diffstat (limited to 'models/swimlanes.js')
-rw-r--r-- | models/swimlanes.js | 15 |
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, |