fix clearing panels on a log out

This commit is contained in:
Damien Churchill 2009-03-20 20:46:36 +00:00
parent d5b7616f98
commit 504f2470ba
2 changed files with 11 additions and 12 deletions

View File

@ -45,7 +45,6 @@ Deluge.ToolBar = {
onLogin: function() {
this.Bar.items.get('logout').enable();
},
onLogout: function() {
@ -334,12 +333,15 @@ Deluge.SideBar = {
onRender: function(bar) {
this.Bar = bar;
Deluge.Events.on("disconnect", this.onDisconnect);
Deluge.Events.on("disconnect", this.onDisconnect.bindWithEvent(this));
this.selected = null;
},
onDisconnect: function() {
this.Bar.items.each(function(panel) {
panel.destroy();
});
this.panels.empty();
},
renderer: function(value, p, r) {

View File

@ -27,6 +27,11 @@ Deluge.Connections = {
},
loginShow: function() {
Deluge.Events.on('logout', function(e) {
Deluge.Connections.disconnect();
Deluge.Connections.Window.hide();
});
Deluge.Client.web.connected({
onSuccess: function(connected) {
if (connected) {
@ -69,13 +74,6 @@ Deluge.Connections = {
selection.selectRow(Deluge.Connections.selectedRow);
},
onRender: function() {
Deluge.Events.on('logout', function(e) {
Deluge.Connections.disconnect();
Deluge.Connections.Window.hide();
});
},
onSelect: function(selModel, rowIndex, record) {
Deluge.Connections.selectedRow = rowIndex;
},
@ -186,7 +184,6 @@ Deluge.Connections.Window = new Ext.Window({
}],
listeners: {
'hide': Deluge.Connections.onClose,
'show': Deluge.Connections.onShow,
'render': Deluge.Connections.onRender
'show': Deluge.Connections.onShow
}
});