mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Use localeCompare to sort torrent list by name
This commit is contained in:
parent
ed83070517
commit
b4acb2ef52
@ -56,15 +56,10 @@ var dynamicTable = new Class ({
|
||||
var reverseSort = tr2.getParent().reverseSort;
|
||||
switch(i) {
|
||||
case 1: // Name
|
||||
if(!reverseSort) {
|
||||
if(tr1.getElements('td')[i].get('html') > tr2.getElements('td')[i].get('html'))
|
||||
return 1;
|
||||
return -1;
|
||||
} else {
|
||||
if(tr1.getElements('td')[i].get('html') < tr2.getElements('td')[i].get('html'))
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
if(!reverseSort)
|
||||
return tr1.getElements('td')[i].get('html').localeCompare(tr2.getElements('td')[i].get('html'));
|
||||
else
|
||||
return tr2.getElements('td')[i].get('html').localeCompare(tr1.getElements('td')[i].get('html'));
|
||||
case 2: // Prio
|
||||
case 3: // Size
|
||||
case 4: // Progress
|
||||
|
Loading…
x
Reference in New Issue
Block a user