fix up the statusbar switching

This commit is contained in:
Damien Churchill 2010-03-14 09:20:57 +00:00
parent 21431f18e1
commit 2952a5a7a3
1 changed files with 13 additions and 10 deletions

View File

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