mirror of
https://github.com/transmission/transmission
synced 2025-02-13 18:04:43 +00:00
in transmission.updateFileList(), move the var declarations to the front of the function.
This commit is contained in:
parent
4803b12a09
commit
c1013ff1a4
1 changed files with 9 additions and 6 deletions
|
@ -1640,24 +1640,27 @@ Transmission.prototype =
|
||||||
},
|
},
|
||||||
updateFileList: function()
|
updateFileList: function()
|
||||||
{
|
{
|
||||||
|
var i, n, tr, sel, row, torrent, fragment;
|
||||||
|
|
||||||
if (!$(this._inspector_file_list).is(':visible'))
|
if (!$(this._inspector_file_list).is(':visible'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var sel = this.getSelectedTorrents();
|
sel = this.getSelectedTorrents();
|
||||||
if (sel.length !== 1) {
|
if (sel.length !== 1) {
|
||||||
this.clearFileList();
|
this.clearFileList();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// build the file list
|
// build the file list
|
||||||
|
torrent = sel[0];
|
||||||
this.clearFileList();
|
this.clearFileList();
|
||||||
this._file_torrent = torrent;
|
this._file_torrent = torrent;
|
||||||
var n = torrent.getFileCount();
|
n = torrent.getFileCount();
|
||||||
this._file_rows = [];
|
this._file_rows = [];
|
||||||
var fragment = document.createDocumentFragment();
|
fragment = document.createDocumentFragment();
|
||||||
var tr = this;
|
tr = this;
|
||||||
for (var i=0; i<n; ++i) {
|
for (i=0; i<n; ++i) {
|
||||||
var row = this._file_rows[i] = new FileRow(torrent, i);
|
row = this._file_rows[i] = new FileRow(torrent, i);
|
||||||
fragment.appendChild(row.getElement());
|
fragment.appendChild(row.getElement());
|
||||||
$(row).bind('wantedToggled',function(e,row,want) {tr.onFileWantedToggled(row,want);});
|
$(row).bind('wantedToggled',function(e,row,want) {tr.onFileWantedToggled(row,want);});
|
||||||
$(row).bind('priorityToggled',function(e,row,priority) {tr.onFilePriorityToggled(row,priority);});
|
$(row).bind('priorityToggled',function(e,row,priority) {tr.onFilePriorityToggled(row,priority);});
|
||||||
|
|
Loading…
Reference in a new issue