mirror of
https://github.com/transmission/transmission
synced 2025-03-05 11:08:04 +00:00
(trunk web) a simple tweak to setInnerHTML() clears out about 20% of the periodic refresh overhead on my setup...
This commit is contained in:
parent
529000a6e2
commit
998c6e6e8e
2 changed files with 13 additions and 9 deletions
|
@ -87,8 +87,14 @@ Array.prototype.clone = function () {
|
||||||
*/
|
*/
|
||||||
function setInnerHTML( e, html )
|
function setInnerHTML( e, html )
|
||||||
{
|
{
|
||||||
if( e.innerHTML != html )
|
/* innerHTML is listed as a string, but the browser seems to change it.
|
||||||
|
* For example, "∞" gets changed to "∞" somewhere down the line.
|
||||||
|
* So, let's use an arbitrary different field to test our state... */
|
||||||
|
if( e.currentHTML != html )
|
||||||
|
{
|
||||||
|
e.currentHTML = html;
|
||||||
e.innerHTML = html;
|
e.innerHTML = html;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -84,7 +84,6 @@ Torrent.prototype =
|
||||||
e.appendChild( image );
|
e.appendChild( image );
|
||||||
top_e.appendChild( e );
|
top_e.appendChild( e );
|
||||||
element._pause_resume_button_image = image;
|
element._pause_resume_button_image = image;
|
||||||
//element._pause_resume_button = e;
|
|
||||||
if (!iPhone) $(e).bind('click', {element: element}, this.clickPauseResumeButton);
|
if (!iPhone) $(e).bind('click', {element: element}, this.clickPauseResumeButton);
|
||||||
|
|
||||||
// Create the 'peer details' <div>
|
// Create the 'peer details' <div>
|
||||||
|
@ -109,13 +108,12 @@ Torrent.prototype =
|
||||||
|
|
||||||
for( var i=0; data.files!=null && i<data.files.length; ++i ) {
|
for( var i=0; data.files!=null && i<data.files.length; ++i ) {
|
||||||
var src = data.files[i];
|
var src = data.files[i];
|
||||||
var tgt = this._file_model[i];
|
this._file_model[i] = {
|
||||||
if( !tgt )
|
'index': i,
|
||||||
tgt = this._file_model[i] = { };
|
'torrent': this,
|
||||||
tgt.index = i;
|
'length': src.length,
|
||||||
tgt.torrent = this;
|
'name': src.name
|
||||||
tgt.length = src.length;
|
};
|
||||||
tgt.name = src.name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update all the labels etc
|
// Update all the labels etc
|
||||||
|
|
Loading…
Add table
Reference in a new issue