Author: damoxc

Revision: 5122

Log:
        add a reloadMethods function to use instead of simply creating a new 
client

Diff:
Modified: trunk/deluge/ui/web/js/Deluge.Client.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.Client.js     2009-04-21 20:34:41 UTC (rev 
5121)
+++ trunk/deluge/ui/web/js/Deluge.Client.js     2009-04-21 21:36:32 UTC (rev 
5122)
@@ -25,6 +25,8 @@
 (function() {
     Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
 
+        _components: [],
+        
         _methods: [],
         
         _requests: {},
@@ -47,7 +49,13 @@
                  */
                  'ready'
             );
-            
+            this.reloadMethods();
+        },
+        
+        reloadMethods: function() {
+            Ext.each(this._components, function(component) {
+                delete this[component];
+            }, this);
             this._execute('system.listMethods', {
                 success: this._setMethods,
                 scope: this
@@ -152,6 +160,7 @@
                 self[name] = components[name];
             }
             
+            this._components = Ext.keys(components);
             this.fireEvent('ready', this);
         }
     });



--~--~---------~--~----~------------~-------~--~----~
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