1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 23:42:33 +01:00

Fixed: Column sort direction will not toggle unless the same column is clicked again.

This commit is contained in:
Taloth Saldono 2015-03-04 00:10:00 +01:00
parent 112cde1cee
commit f39e99bd3c

View File

@ -97,11 +97,16 @@ 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 (direction === 'ascending' || direction === -1) { if (column.get('sortType') === 'fixed' || !isSorted) {
direction = 'descending'; direction = column.get('direction') || 'ascending';
} else { } else {
direction = 'ascending'; if (direction === 'ascending' || direction === -1) {
direction = 'descending';
} else {
direction = 'ascending';
}
} }
if (collection.setSorting) { if (collection.setSorting) {