mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Save torrent list sort order in local storage
This commit is contained in:
@@ -42,18 +42,20 @@ var dynamicTable = new Class({
|
||||
this.priority_hidden = false;
|
||||
this.progressIndex = progressIndex;
|
||||
this.context_menu = context_menu;
|
||||
this.table.sortedColumn = 'name'; // Default is NAME
|
||||
this.table.reverseSort = false;
|
||||
this.table.sortedColumn = getLocalStorageItem('sorted_column', 'name');
|
||||
this.table.reverseSort = getLocalStorageItem('reverse_sort', 'false');;
|
||||
},
|
||||
|
||||
setSortedColumn : function (column) {
|
||||
if (column != this.table.sortedColumn) {
|
||||
this.table.sortedColumn = column;
|
||||
this.table.reverseSort = false;
|
||||
this.table.reverseSort = 'false';
|
||||
} else {
|
||||
// Toggle sort order
|
||||
this.table.reverseSort = !this.table.reverseSort;
|
||||
this.table.reverseSort = this.table.reverseSort == 'true' ? 'false' : 'true';
|
||||
}
|
||||
localStorage.setItem('sorted_column', column);
|
||||
localStorage.setItem('reverse_sort', this.table.reverseSort);
|
||||
},
|
||||
|
||||
getCurrentTorrentHash : function () {
|
||||
|
||||
Reference in New Issue
Block a user