(trunk web) a simple tweak to setInnerHTML() clears out about 20% of the periodic refresh overhead on my setup...

This commit is contained in:
Charles Kerr 2009-05-23 21:14:03 +00:00
parent 529000a6e2
commit 998c6e6e8e
2 changed files with 13 additions and 9 deletions

View File

@ -87,8 +87,14 @@ Array.prototype.clone = function () {
*/
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;
}
};
/*

View File

@ -84,7 +84,6 @@ Torrent.prototype =
e.appendChild( image );
top_e.appendChild( e );
element._pause_resume_button_image = image;
//element._pause_resume_button = e;
if (!iPhone) $(e).bind('click', {element: element}, this.clickPauseResumeButton);
// Create the 'peer details' <div>
@ -109,13 +108,12 @@ Torrent.prototype =
for( var i=0; data.files!=null && i<data.files.length; ++i ) {
var src = data.files[i];
var tgt = this._file_model[i];
if( !tgt )
tgt = this._file_model[i] = { };
tgt.index = i;
tgt.torrent = this;
tgt.length = src.length;
tgt.name = src.name;
this._file_model[i] = {
'index': i,
'torrent': this,
'length': src.length,
'name': src.name
};
}
// Update all the labels etc