mirror of https://github.com/Radarr/Radarr
Fixed: Column sort direction will not toggle unless the same column is clicked again.
This commit is contained in:
parent
112cde1cee
commit
f39e99bd3c
|
@ -97,12 +97,17 @@ module.exports = function() {
|
||||||
var column = this.column;
|
var column = this.column;
|
||||||
var sortable = Backgrid.callByNeed(column.sortable(), column, collection);
|
var sortable = Backgrid.callByNeed(column.sortable(), column, collection);
|
||||||
if (sortable) {
|
if (sortable) {
|
||||||
|
var isSorted = this.$el.children('.icon-sonarr-sort-asc,.icon-sonarr-sort-desc').length !== 0;
|
||||||
var direction = collection.state.order;
|
var direction = collection.state.order;
|
||||||
|
if (column.get('sortType') === 'fixed' || !isSorted) {
|
||||||
|
direction = column.get('direction') || 'ascending';
|
||||||
|
} else {
|
||||||
if (direction === 'ascending' || direction === -1) {
|
if (direction === 'ascending' || direction === -1) {
|
||||||
direction = 'descending';
|
direction = 'descending';
|
||||||
} else {
|
} else {
|
||||||
direction = 'ascending';
|
direction = 'ascending';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (collection.setSorting) {
|
if (collection.setSorting) {
|
||||||
collection.setSorting(column.get('name'), direction);
|
collection.setSorting(column.get('name'), direction);
|
||||||
|
|
Loading…
Reference in New Issue