mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 17:48:49 +01:00
Add Features: allowing lists to be sorted by modifiedAt when not in draggable mode
This commit is contained in:
parent
e60926f847
commit
77f8b76d4e
7 changed files with 63 additions and 39 deletions
|
|
@ -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 } });
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue