mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 07:58:38 +00:00
use createDelegate and add the onHide method that stops updating the hosts grid
This commit is contained in:
parent
68b5f92ec0
commit
7bd5ba3cdb
1 changed files with 12 additions and 9 deletions
|
@ -161,10 +161,8 @@ Copyright:
|
||||||
|
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
Ext.deluge.ConnectionManager.superclass.initComponent.call(this);
|
Ext.deluge.ConnectionManager.superclass.initComponent.call(this);
|
||||||
this.on({
|
this.on('hide', this.onHide, this);
|
||||||
'hide': this.onHide,
|
this.on('show', this.onShow, this);
|
||||||
'show': this.onShow
|
|
||||||
});
|
|
||||||
Deluge.Events.on('login', this.onLogin, this);
|
Deluge.Events.on('login', this.onLogin, this);
|
||||||
Deluge.Events.on('logout', this.onLogout, this);
|
Deluge.Events.on('logout', this.onLogout, this);
|
||||||
|
|
||||||
|
@ -243,6 +241,8 @@ Copyright:
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.update = this.update.createDelegate(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
disconnect: function() {
|
disconnect: function() {
|
||||||
|
@ -256,11 +256,11 @@ Copyright:
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
update: function(self) {
|
update: function() {
|
||||||
self.grid.getStore().each(function(r) {
|
this.grid.getStore().each(function(r) {
|
||||||
Deluge.Client.web.get_host_status(r.id, {
|
Deluge.Client.web.get_host_status(r.id, {
|
||||||
success: self.onGetHostStatus,
|
success: this.onGetHostStatus,
|
||||||
scope: self
|
scope: this
|
||||||
});
|
});
|
||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
|
@ -337,7 +337,6 @@ Copyright:
|
||||||
}, this, {single: true});
|
}, this, {single: true});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (this.running) window.clearInterval(this.running);
|
|
||||||
this.hide();
|
this.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -360,6 +359,10 @@ Copyright:
|
||||||
if (this.grid.getSelectionModel().getSelected() == record) this.updateButtons(record);
|
if (this.grid.getSelectionModel().getSelected() == record) this.updateButtons(record);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onHide: function() {
|
||||||
|
if (this.running) window.clearInterval(this.running);
|
||||||
|
},
|
||||||
|
|
||||||
onLogin: function() {
|
onLogin: function() {
|
||||||
Deluge.Client.web.connected({
|
Deluge.Client.web.connected({
|
||||||
success: function(connected) {
|
success: function(connected) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue