mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 16:08:40 +00:00
add a reloadMethods function to use instead of simply creating a new
client
This commit is contained in:
parent
b62a5d7329
commit
e1e45753de
1 changed files with 10 additions and 1 deletions
|
@ -25,6 +25,8 @@ Ext.namespace('Ext.ux.util');
|
||||||
(function() {
|
(function() {
|
||||||
Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
|
Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
|
||||||
|
|
||||||
|
_components: [],
|
||||||
|
|
||||||
_methods: [],
|
_methods: [],
|
||||||
|
|
||||||
_requests: {},
|
_requests: {},
|
||||||
|
@ -47,7 +49,13 @@ Ext.namespace('Ext.ux.util');
|
||||||
*/
|
*/
|
||||||
'ready'
|
'ready'
|
||||||
);
|
);
|
||||||
|
this.reloadMethods();
|
||||||
|
},
|
||||||
|
|
||||||
|
reloadMethods: function() {
|
||||||
|
Ext.each(this._components, function(component) {
|
||||||
|
delete this[component];
|
||||||
|
}, this);
|
||||||
this._execute('system.listMethods', {
|
this._execute('system.listMethods', {
|
||||||
success: this._setMethods,
|
success: this._setMethods,
|
||||||
scope: this
|
scope: this
|
||||||
|
@ -152,6 +160,7 @@ Ext.namespace('Ext.ux.util');
|
||||||
self[name] = components[name];
|
self[name] = components[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._components = Ext.keys(components);
|
||||||
this.fireEvent('ready', this);
|
this.fireEvent('ready', this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue