add clearing the tree when the selection is changed

This commit is contained in:
Damien Churchill 2009-03-31 00:41:05 +00:00
parent 3bd13595be
commit e608db8ce2

View File

@ -68,7 +68,14 @@ Deluge.Add = {
}
});
}
walk(torrentInfo['files'], Deluge.Add.Files.getRootNode());
var root = Deluge.Add.Files.getRootNode();
if (!root.hasChildNodes()) return;
root.cascade(function(node) {
if (!node.parentNode || !node.getOwnerTree()) return;
node.remove();
});
walk(torrentInfo['files'], root);
},
onTorrentAdded: function(info) {