mirror of
https://github.com/transmission/transmission
synced 2024-12-24 00:34:04 +00:00
(trunk web) #3278 "add sorting by size support to web client" -- fixed.
This commit is contained in:
parent
ead0ea9800
commit
cbf51842c8
4 changed files with 10 additions and 4 deletions
|
@ -419,6 +419,7 @@
|
|||
<li id="sort_by_name">Name</li>
|
||||
<li id="sort_by_percent_completed">Progress</li>
|
||||
<li id="sort_by_queue_order">Queue Order</li>
|
||||
<li id="sort_by_size">Size</li>
|
||||
<li id="sort_by_state">State</li>
|
||||
<li class="separator"></li>
|
||||
<li id="reverse_sort_order">Reverse Sort Order</li>
|
||||
|
|
|
@ -181,7 +181,6 @@ function tellUser( primaryText, secondaryText )
|
|||
$("#dialog_body").html("<p><b>" + primaryText + "</b></p><p>" + secondaryText + "</p>" );
|
||||
$("#dialog" ).dialog( {
|
||||
title: primaryText,
|
||||
show: 'blind',
|
||||
hide: 'blind',
|
||||
buttons: { 'Close': function() { $(this).dialog('close'); } }
|
||||
});
|
||||
|
@ -205,7 +204,6 @@ function askUser(dialog_heading, dialog_message, confirm_button_label,
|
|||
};
|
||||
$("#dialog" ).dialog( {
|
||||
title: dialog_heading,
|
||||
show: 'blind',
|
||||
hide: 'blind',
|
||||
buttons: myButtons
|
||||
});
|
||||
|
@ -242,6 +240,7 @@ Prefs._SortByActivity = 'activity';
|
|||
Prefs._SortByQueue = 'queue_order';
|
||||
Prefs._SortByName = 'name';
|
||||
Prefs._SortByProgress = 'percent_completed';
|
||||
Prefs._SortBySize = 'size';
|
||||
Prefs._SortByState = 'state';
|
||||
Prefs._SortByTracker = 'tracker';
|
||||
|
||||
|
|
|
@ -781,6 +781,11 @@ Torrent.compareByActivity = function( a, b ) {
|
|||
return a.activity() - b.activity();
|
||||
};
|
||||
|
||||
/** Helper function for sortTorrents(). */
|
||||
Torrent.compareBySize = function( a, b ) {
|
||||
return a.size() - b.size();
|
||||
}
|
||||
|
||||
/** Helper function for sortTorrents(). */
|
||||
Torrent.compareByProgress = function( a, b ) {
|
||||
if( a.getPercentDone() !== b.getPercentDone() )
|
||||
|
@ -817,6 +822,9 @@ Torrent.sortTorrents = function( torrents, sortMethod, sortDirection )
|
|||
case Prefs._SortByName:
|
||||
torrents.sort( this.compareByName );
|
||||
break;
|
||||
case Prefs._SortBySize:
|
||||
torrents.sort( this.compareBySize );
|
||||
break;
|
||||
default:
|
||||
console.warn( "unknown sort method: " + sortMethod );
|
||||
break;
|
||||
|
|
|
@ -909,7 +909,6 @@ Transmission.prototype =
|
|||
resizable: !fullscreen,
|
||||
draggable: !fullscreen,
|
||||
title: 'Preferences',
|
||||
show: 'blind',
|
||||
hide: 'blind',
|
||||
buttons: { }
|
||||
};
|
||||
|
@ -1069,7 +1068,6 @@ Transmission.prototype =
|
|||
tr.togglePeriodicStatsRefresh(true);
|
||||
$("#stats_dialog" ).dialog( {
|
||||
title: 'Statistics',
|
||||
show: 'blind',
|
||||
hide: 'blind',
|
||||
width: 200,
|
||||
buttons: {
|
||||
|
|
Loading…
Reference in a new issue