Module: deluge
Branch: master
Commit: 2952a5a7a338a67729429b4237171b302d8ddd36

Author: Damien Churchill <[email protected]>
Date:   Sun Mar 14 09:20:57 2010 +0000

fix up the statusbar switching

---

 deluge/ui/web/js/deluge-all/Deluge.Statusbar.js |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js 
b/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js
index 8eb353f..cbb0d0f 100644
--- a/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js
+++ b/deluge/ui/web/js/deluge-all/Deluge.Statusbar.js
@@ -16,7 +16,7 @@ Ext.deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
        },
        
        createButtons: function() {
-               this.add({
+               this.buttons = this.add({
                        id: 'statusbar-connections',
                        text: ' ',
                        cls: 'x-btn-text-icon',
@@ -60,25 +60,28 @@ Ext.deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
        },
        
        onConnect: function() {
-               //this.setStatus({
-               //      iconCls: 'x-connected',
-               //      text: ''
-               //});
-               if (!this.created) this.createButtons();
-               else {
-                       this.items.each(function(item) {
+               this.setStatus({
+                       iconCls: 'x-connected',
+                       text: ''
+               });
+               if (!this.created) {
+                       this.createButtons();
+               } else {
+                       Ext.each(this.buttons, function(item) {
                                item.show();
                                item.enable();
                        });
                }
+               this.doLayout();
        },
 
        onDisconnect: function() {
-               //this.clearStatus({useDefaults:true});
-               this.items.each(function(item) {
+               this.clearStatus({useDefaults:true});
+               Ext.each(this.buttons, function(item) {
                        item.hide();
                        item.disable();
                });
+               this.doLayout();
        },
        
        update: function(stats) {

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