mirror of
https://github.com/transmission/transmission
synced 2025-02-12 09:25:03 +00:00
(trunk web) Stop poking the torrent-row's progressbar's style.display fields unless the new value differs from the old. It's probably browser-dependent on whether or not this speeds anything up, but FF seems to like it.
This commit is contained in:
parent
354a92c73d
commit
8949fbb01c
1 changed files with 21 additions and 8 deletions
|
@ -64,17 +64,30 @@ TorrentRendererHelper.createProgressbar = function(classes)
|
|||
|
||||
TorrentRendererHelper.renderProgressbar = function(controller, t, progressbar)
|
||||
{
|
||||
var info = TorrentRendererHelper.getProgressInfo(controller, t);
|
||||
var e;
|
||||
var display;
|
||||
var info = TorrentRendererHelper.getProgressInfo(controller, t);
|
||||
|
||||
// update the complete progressbar
|
||||
e = progressbar.complete;
|
||||
e.style.width = '' + info.percent + "%";
|
||||
if (e.className !== info.complete)
|
||||
e.className = info.complete;
|
||||
e.style.display = info.percent<=0 ? 'none' : 'block';
|
||||
if (info.percent > 0) {
|
||||
display = 'block';
|
||||
e.style.width = '' + info.percent + '%';
|
||||
} else {
|
||||
display = 'none';
|
||||
}
|
||||
if (e.style.display !== display)
|
||||
e.style.display = display;
|
||||
if (e.style.className !== info.complete)
|
||||
e.style.className = info.complete;
|
||||
|
||||
// update the incomplete progressbar
|
||||
e = progressbar.incomplete;
|
||||
if (e.className !== info.incomplete)
|
||||
e.className = info.incomplete;
|
||||
e.style.display = info.percent>=100 ? 'none' : 'block';
|
||||
display = (info.percent < 100) ? 'block' : 'none';
|
||||
if (e.style.display !== display)
|
||||
e.style.display = display;
|
||||
if (e.style.className !== info.incomplete)
|
||||
e.style.className = info.incomplete;
|
||||
};
|
||||
|
||||
TorrentRendererHelper.formatUL = function(t)
|
||||
|
|
Loading…
Reference in a new issue