(trunk web) huge speed improments when initalize files

This commit is contained in:
Kevin Glowacz 2009-05-23 06:09:57 +00:00
parent 6ed3538e8c
commit f8ff6b415a
1 changed files with 26 additions and 15 deletions

View File

@ -652,22 +652,33 @@ TorrentFile.prototype = {
else else
this.name = file_data.name; this.name = file_data.name;
this.readAttributes(file_data); this.readAttributes(file_data);
var li = document.createElement('li');
var wanted_div = document.createElement('div');
wanted_div.className = "file_wanted_control";
var pri_div = document.createElement('div');
pri_div.className = "file_priority_control";
var file_div = document.createElement('div');
file_div.className = "inspector_torrent_file_list_entry_name";
file_div.textContent = this.name;
var prog_div = document.createElement('div');
prog_div.className = "inspector_torrent_file_list_entry_progress";
li.appendChild(wanted_div);
li.appendChild(pri_div);
li.appendChild(file_div);
li.appendChild(prog_div);
this._element = $('<li/>').append( this._element = $(li);
$('<div/>').addClass('file_wanted_control'). this._priority_control = $(pri_div);
bind('click', { file: this }, this.fileWantedControlClicked) this._progress = $(prog_div);
).append( $(wanted_div).bind('click', { file: this }, this.fileWantedControlClicked);
this._priority_control = $('<div/>').addClass('file_priority_control'). this._priority_control.bind('click', { file: this }, this.filePriorityControlClicked);
bind('click', { file: this }, this.filePriorityControlClicked)
).append(
$('<div/>').addClass('inspector_torrent_file_list_entry_name').
append(this.name)
).append(
this._progress = $('<div/>').addClass('inspector_torrent_file_list_entry_progress')
)
}, },
readAttributes: function(file_data) { readAttributes: function(file_data) {