From b07715862fa4898f5373a802e5c75f040627af80 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 2 Apr 2009 19:28:27 +0000 Subject: [PATCH] clear the files tree on add/cancel --- deluge/ui/web/js/deluge-add.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deluge/ui/web/js/deluge-add.js b/deluge/ui/web/js/deluge-add.js index 4a8a93a25..391376271 100644 --- a/deluge/ui/web/js/deluge-add.js +++ b/deluge/ui/web/js/deluge-add.js @@ -24,6 +24,12 @@ Copyright: Deluge.Add = { torrents: new Hash(), + clear: function() { + this.clearFiles(); + this.Store.loadData([]); + this.torrents.empty(); + }, + clearFiles: function() { var root = this.Files.getRootNode(); if (!root.hasChildNodes()) return; @@ -45,8 +51,7 @@ Deluge.Add = { onSuccess: function(result) { } }) - this.Store.loadData([]); - this.torrents.empty(); + this.clear(); this.Window.hide(); }, @@ -350,6 +355,7 @@ Deluge.Add.Window = new Ext.Window({ buttons: [{ text: _('Cancel'), handler: function() { + Deluge.Add.clear(); Deluge.Add.Window.hide(); } }, {