Author: damoxc
Revision: 4902
Log:
fix clearing panels on a log out
Diff:
Modified: trunk/deluge/ui/web/js/deluge-bars.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-bars.js 2009-03-20 19:20:07 UTC (rev
4901)
+++ trunk/deluge/ui/web/js/deluge-bars.js 2009-03-20 20:46:36 UTC (rev
4902)
@@ -45,7 +45,6 @@
onLogin: function() {
this.Bar.items.get('logout').enable();
-
},
onLogout: function() {
@@ -334,12 +333,15 @@
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) {
Modified: trunk/deluge/ui/web/js/deluge-connections.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-connections.js 2009-03-20 19:20:07 UTC
(rev 4901)
+++ trunk/deluge/ui/web/js/deluge-connections.js 2009-03-20 20:46:36 UTC
(rev 4902)
@@ -27,6 +27,11 @@
},
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 @@
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 @@
}],
listeners: {
'hide': Deluge.Connections.onClose,
- 'show': Deluge.Connections.onShow,
- 'render': Deluge.Connections.onRender
+ 'show': Deluge.Connections.onShow
}
});
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---