mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-04 07:33:31 +00:00
fix the file icon on files
fix clearing the tree when a different torrent is selected
This commit is contained in:
parent
0b9b261038
commit
a32b43b414
@ -62,7 +62,7 @@ Deluge.Add = {
|
||||
size: fsize(item[0]),
|
||||
leaf: true,
|
||||
checked: item[1],
|
||||
iconCls: 'x-deluge-add-file',
|
||||
icon: '/icons/16/document.png',
|
||||
uiProvider: Ext.tree.ColumnNodeUI
|
||||
}));
|
||||
}
|
||||
|
@ -203,7 +203,11 @@ Deluge.Details.Files = {
|
||||
this.panel.update = this.update.bind(this);
|
||||
},
|
||||
|
||||
onRequestComplete: function(files) {
|
||||
onRequestComplete: function(files, torrentId) {
|
||||
if (this.torrentId != torrentId) {
|
||||
this.clear();
|
||||
this.torrentId = torrentId;
|
||||
}
|
||||
function walk(files, parent) {
|
||||
$each(files, function(item, file) {
|
||||
var child = parent.findChild('id', file);
|
||||
@ -224,7 +228,7 @@ Deluge.Details.Files = {
|
||||
size: fsize(item[0]),
|
||||
progress: item[1],
|
||||
leaf: true,
|
||||
iconCls: 'x-deluge-file',
|
||||
icon: '/icons/16/document.png',
|
||||
uiProvider: Ext.tree.ColumnNodeUI
|
||||
});
|
||||
parent.appendChild(child);
|
||||
@ -237,7 +241,13 @@ Deluge.Details.Files = {
|
||||
},
|
||||
|
||||
clear: function() {
|
||||
|
||||
var root = this.panel.getRootNode();
|
||||
if (!root.hasChildNodes()) return;
|
||||
root.cascade(function(node) {
|
||||
var parent = node.parentNode;
|
||||
if (!parent) return;
|
||||
parent.removeChild(node);
|
||||
});
|
||||
},
|
||||
|
||||
update: function(torrentId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user