mirror of
https://github.com/wekan/wekan.git
synced 2025-12-31 14:48:48 +01:00
added sort feature for viewing of cards
This commit is contained in:
parent
49df8f4b43
commit
2226ece4b7
3 changed files with 75 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
const DOWNCLS = 'fa-sort-down';
|
||||
const UPCLS = 'fa-sort-up';
|
||||
*/
|
||||
const sortCardsBy = new ReactiveVar('')
|
||||
Template.boardMenuPopup.events({
|
||||
'click .js-rename-board': Popup.open('boardChangeTitle'),
|
||||
'click .js-custom-fields'() {
|
||||
|
|
@ -110,6 +111,7 @@ BlazeComponent.extendComponent({
|
|||
'click .js-open-filter-view'() {
|
||||
Sidebar.setView('filter');
|
||||
},
|
||||
'click .js-sort-cards': Popup.open('cardsSort'),
|
||||
/*
|
||||
'click .js-open-sort-view'(evt) {
|
||||
const target = evt.target;
|
||||
|
|
@ -368,3 +370,53 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
}).register('listsortPopup');
|
||||
*/
|
||||
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
'click .js-sort-due'() {
|
||||
const sortBy = {
|
||||
'dueAt': 1
|
||||
}
|
||||
Session.set('sortBy',sortBy)
|
||||
sortCardsBy.set('Due Date')
|
||||
Popup.close();
|
||||
},
|
||||
'click .js-sort-title'() {
|
||||
const sortBy = {
|
||||
'title': 1
|
||||
}
|
||||
Session.set('sortBy',sortBy)
|
||||
sortCardsBy.set('Title')
|
||||
Popup.close();
|
||||
},
|
||||
'click .js-sort-created-asc'() {
|
||||
const sortBy = {
|
||||
'createdAt': 1
|
||||
}
|
||||
Session.set('sortBy',sortBy)
|
||||
sortCardsBy.set('Date Created (Newest First)')
|
||||
Popup.close();
|
||||
},
|
||||
'click .js-sort-created-desc'() {
|
||||
const sortBy = {
|
||||
'createdAt': -1
|
||||
}
|
||||
Session.set('sortBy',sortBy)
|
||||
sortCardsBy.set('Date Created (Oldest First)')
|
||||
Popup.close();
|
||||
},
|
||||
'click .js-sort-default'() {
|
||||
const sortBy = {
|
||||
'sort': 1
|
||||
}
|
||||
Session.set('sortBy',sortBy)
|
||||
sortCardsBy.set('Default')
|
||||
Popup.close();
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
}).register('cardsSortPopup');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue