1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 16:24:02 +00:00

(clutch) #1161: hiding the web ui's filter bar should clear the filters

This commit is contained in:
Charles Kerr 2008-08-10 15:48:14 +00:00
parent e45d547aae
commit 098f4b48c7

View file

@ -576,26 +576,34 @@ Transmission.prototype =
if (transmission.isButtonEnabled(event)) if (transmission.isButtonEnabled(event))
transmission.toggleFilter(); transmission.toggleFilter();
}, },
setFilter: function( mode ) { setFilter: function( mode )
{
// update the radiobuttons
var c;
switch( mode ) {
case Prefs._FilterAll: c = '#filter_all_link'; break;
case Prefs._FilterSeeding: c = '#filter_seeding_link'; break;
case Prefs._FilterDownloading: c = '#filter_downloading_link'; break;
case Prefs._FilterPaused: c = '#filter_paused_link'; break;
}
$(c).parent().siblings().removeClass('selected');
$(c).parent().addClass('selected');
// do the filtering
this.setPref( Prefs._FilterMode, mode ); this.setPref( Prefs._FilterMode, mode );
this.refilter( ); this.refilter( );
}, },
setFilterFromButton: function( element, mode ) {
$(element).siblings().removeClass('selected');
$(element).addClass('selected');
this.setFilter( mode );
},
showAllClicked: function( event ) { showAllClicked: function( event ) {
transmission.setFilterFromButton( this, Prefs._FilterAll ); transmission.setFilter( Prefs._FilterAll );
}, },
showDownloadingClicked: function( event ) { showDownloadingClicked: function( event ) {
transmission.setFilterFromButton( this, Prefs._FilterDownloading ); transmission.setFilter( Prefs._FilterDownloading );
}, },
showSeedingClicked: function(event) { showSeedingClicked: function(event) {
transmission.setFilterFromButton( this, Prefs._FilterSeeding ); transmission.setFilter( Prefs._FilterSeeding );
}, },
showPausedClicked: function(event) { showPausedClicked: function(event) {
transmission.setFilterFromButton( this, Prefs._FilterPaused ); transmission.setFilter( Prefs._FilterPaused );
}, },
/* /*
@ -971,11 +979,13 @@ Transmission.prototype =
this.setPref( Prefs._ShowFilter, true ); this.setPref( Prefs._ShowFilter, true );
}, },
hideFilter: function() { hideFilter: function()
{
var container_top = parseInt($('#torrent_container').css('top')) - $('#torrent_filter_bar').height() - 1; var container_top = parseInt($('#torrent_container').css('top')) - $('#torrent_filter_bar').height() - 1;
$('#torrent_container').css('top', container_top + 'px'); $('#torrent_container').css('top', container_top + 'px');
$('#torrent_filter_bar').hide(); $('#torrent_filter_bar').hide();
this.setPref( Prefs._ShowFilter, false ); this.setPref( Prefs._ShowFilter, false );
this.setFilter( Prefs._FilterAll );
}, },
/* /*