1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-04 02:28:03 +00:00

(web) #3456:Improve web client torrent list display

This commit is contained in:
Daniel Lee 2010-07-31 16:28:00 +00:00
parent b5dabf2968
commit 222261cb64
4 changed files with 28 additions and 1 deletions

View file

@ -8,6 +8,7 @@
var transmission; var transmission;
var dialog; var dialog;
var resizeTimer = null;
// Test for a Webkit build that supports box-shadow: 521+ (release Safari 3 is // Test for a Webkit build that supports box-shadow: 521+ (release Safari 3 is
// actually 523.10.3). We need 3.1 for CSS animation (dialog sheets) but as it // actually 523.10.3). We need 3.1 for CSS animation (dialog sheets) but as it
// degrades gracefully let's not worry too much. // degrades gracefully let's not worry too much.
@ -79,6 +80,13 @@ $(document).ready( function() {
$('body div#torrent_container').css('min-height', '338px'); $('body div#torrent_container').css('min-height', '338px');
$("label[for=torrent_upload_url]").text("URL: "); $("label[for=torrent_upload_url]").text("URL: ");
} }
// Add resize event handler with a timeout to handle browsers that fire a
// resize event for every pixel changed
$(window).bind('resize', function() {
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout('transmission.refreshDisplay()', 50)
});
}); });
/* /*

View file

@ -662,6 +662,14 @@ Torrent.prototype =
} }
setInnerHTML( root._progress_details_container, progress_details ); setInnerHTML( root._progress_details_container, progress_details );
if( compact ){
var width = root._progress_details_container.offsetLeft - root._name_container.offsetLeft;
root._name_container.style.width = width + 'px';
}
else {
root._name_container.style.width = '100%';
}
// Update the peer details and pause/resume button // Update the peer details and pause/resume button
e = root._pause_resume_button_image; e = root._pause_resume_button_image;
if ( this.state() === Torrent._StatusPaused ) { if ( this.state() === Torrent._StatusPaused ) {

View file

@ -1532,6 +1532,7 @@ Transmission.prototype =
this.setPref( Prefs._ShowInspector, true ); this.setPref( Prefs._ShowInspector, true );
this.updateInspector( ); this.updateInspector( );
this.refreshDisplay( );
}, },
/* /*
@ -1553,6 +1554,7 @@ Transmission.prototype =
} }
this.setPref( Prefs._ShowInspector, false ); this.setPref( Prefs._ShowInspector, false );
this.refreshDisplay( );
}, },
/* /*
@ -1961,6 +1963,7 @@ Transmission.prototype =
this.setTorrentBgColors( ); this.setTorrentBgColors( );
this.updateStatusbar( ); this.updateStatusbar( );
this.selectionChanged( ); this.selectionChanged( );
this.refreshDisplay( );
}, },
setEnabled: function( key, flag ) setEnabled: function( key, flag )

View file

@ -397,8 +397,9 @@ ul.torrent_list li.torrent.selected {
ul.torrent_list li.torrent div.torrent_name { ul.torrent_list li.torrent div.torrent_name {
font-size: 1.3em; font-size: 1.3em;
font-weight: bold; font-weight: bold;
word-wrap: break-word;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #222; color: #222;
margin-bottom: 2px; margin-bottom: 2px;
} }
@ -407,6 +408,9 @@ ul.torrent_list li.torrent div.torrent_name.compact {
float: left; float: left;
z-index: 1; z-index: 1;
position: absolute; position: absolute;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
ul.torrent_list li.torrent.selected div.torrent_name { ul.torrent_list li.torrent.selected div.torrent_name {
@ -415,7 +419,11 @@ ul.torrent_list li.torrent.selected div.torrent_name {
ul.torrent_list li.torrent div.torrent_progress_details, ul.torrent_list li.torrent div.torrent_progress_details,
ul.torrent_list li.torrent div.torrent_peer_details { ul.torrent_list li.torrent div.torrent_peer_details {
clear: left;
font-size: 1em; font-size: 1em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
ul.torrent_list li.torrent div.torrent_progress_details.error { ul.torrent_list li.torrent div.torrent_progress_details.error {