in file-row getPath(), don't leak 'path' into the global namespace
This commit is contained in:
parent
b4b7483f2e
commit
7b7da2d315
|
@ -174,10 +174,10 @@ function FileRow(torrent, i)
|
|||
};
|
||||
this.getPath = function () {
|
||||
var file = torrent.getFile(i);
|
||||
path = file.name.replace(/\/\/+/g,'/')
|
||||
path = path.split('/').slice(0,-1)
|
||||
path.push('t' + fields.torrent.getId() + 'f' + fields.index)
|
||||
return path
|
||||
var path = file.name.replace(/\/\/+/g,'/');
|
||||
path = path.split('/').slice(0,-1);
|
||||
path.push('t' + fields.torrent.getId() + 'f' + fields.index);
|
||||
return path;
|
||||
};
|
||||
|
||||
initialize(torrent, i);
|
||||
|
|
|
@ -513,7 +513,7 @@ function Inspector(controller) {
|
|||
n = tor.getFileCount();
|
||||
data.file_rows = [];
|
||||
fragment = document.createDocumentFragment();
|
||||
heirarchy = {'/':[]}
|
||||
heirarchy = {'/':[]}
|
||||
|
||||
for (i=0; i<n; ++i) {
|
||||
row = data.file_rows[i] = new FileRow(tor, i);
|
||||
|
@ -537,6 +537,7 @@ function Inspector(controller) {
|
|||
}
|
||||
}
|
||||
}
|
||||
console.log(heirarchy);
|
||||
/*
|
||||
At this point we have a single object containing the whole
|
||||
torrent heirarchy. The '/' key is file element ids as assigned above
|
||||
|
|
Loading…
Reference in New Issue