mirror of
https://github.com/wekan/wekan.git
synced 2025-12-28 21:28:49 +01:00
fix sort cards feature
This commit is contained in:
parent
ee323d97b4
commit
4aad9ca498
2 changed files with 16 additions and 11 deletions
|
|
@ -54,6 +54,10 @@ Template.boardChangeTitlePopup.events({
|
|||
});
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
onCreated(){
|
||||
// set sort to default
|
||||
Session.set('sortBy','')
|
||||
},
|
||||
watchLevel() {
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
return currentBoard && currentBoard.getWatchLevel(Meteor.userId());
|
||||
|
|
@ -129,6 +133,9 @@ BlazeComponent.extendComponent({
|
|||
Sidebar.setView();
|
||||
Filter.reset();
|
||||
},
|
||||
'click .js-sort-reset'() {
|
||||
Session.set('sortBy','')
|
||||
},
|
||||
'click .js-open-search-view'() {
|
||||
Sidebar.setView('search');
|
||||
},
|
||||
|
|
@ -162,6 +169,9 @@ Template.boardHeaderBar.helpers({
|
|||
boardView() {
|
||||
return Utils.boardView();
|
||||
},
|
||||
isSortActive(){
|
||||
return Session.get('sortBy') ? true : false;
|
||||
}
|
||||
});
|
||||
|
||||
Template.boardChangeViewPopup.events({
|
||||
|
|
@ -406,15 +416,7 @@ BlazeComponent.extendComponent({
|
|||
Session.set('sortBy', sortBy);
|
||||
sortCardsBy.set(TAPi18n.__('date-created-oldest-first'));
|
||||
Popup.close();
|
||||
},
|
||||
'click .js-sort-default'() {
|
||||
const sortBy = {
|
||||
sort: 1,
|
||||
};
|
||||
Session.set('sortBy', sortBy);
|
||||
sortCardsBy.set(TAPi18n.__('default'));
|
||||
Popup.close();
|
||||
},
|
||||
}
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue