Skip to content

Commit

Permalink
Listen for an event on the parent, rather than the target panel.
Browse files Browse the repository at this point in the history
This circumvents the bug that was causing the panel to be hidden when
a listener was attached to the 'show' event.
  • Loading branch information
nelstrom committed May 24, 2011
1 parent 380b75a commit e51c01a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions public/app/views/InfoBar.js
Expand Up @@ -20,9 +20,6 @@ App.views.InfoBar = Ext.extend(Ext.Panel, {
"</dl>"
],

//show: function() {
//this.update(infoBarPanel);
//}
};

Ext.apply(this, {
Expand All @@ -37,7 +34,7 @@ App.views.InfoBar = Ext.extend(Ext.Panel, {
items: [
{ xtype: 'spacer' },
{
text: 'image',
text: 'info',
handler: function() {
if (this.getText() == 'image') {
infoBarPanel.setActiveItem('image_' + infoBarPanel.slug);
Expand All @@ -51,8 +48,15 @@ App.views.InfoBar = Ext.extend(Ext.Panel, {
]
}
],
items: [infoCard, imageCard]
//items: [imageCard, infoCard]

items: [imageCard, infoCard],

listeners: {
beforecardswitch: function() {
var infoPanel = this.getComponent('info_' + this.slug);
infoPanel.update(this);
}
}
});

App.views.InfoBar.superclass.initComponent.call(this);
Expand Down

0 comments on commit e51c01a

Please sign in to comment.