Author: damoxc

Revision: 4995

Log:
        clear the files tree on add/cancel

Diff:
Modified: trunk/deluge/ui/web/js/deluge-add.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-add.js        2009-04-02 19:26:32 UTC (rev 
4994)
+++ trunk/deluge/ui/web/js/deluge-add.js        2009-04-02 19:28:27 UTC (rev 
4995)
@@ -24,6 +24,12 @@
 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 @@
                        onSuccess: function(result) {
                        }
                })
-               this.Store.loadData([]);
-               this.torrents.empty();
+               this.clear();
                this.Window.hide();
        },
        
@@ -350,6 +355,7 @@
     buttons: [{
         text: _('Cancel'),
                handler: function() {
+                       Deluge.Add.clear();
                        Deluge.Add.Window.hide();
                }
     }, {



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to