From e51c01a66f1d1cb24bb0d265e7546915632a1c7c Mon Sep 17 00:00:00 2001 From: Drew Neil Date: Tue, 24 May 2011 14:56:33 +0300 Subject: [PATCH] Listen for an event on the parent, rather than the target panel. This circumvents the bug that was causing the panel to be hidden when a listener was attached to the 'show' event. --- public/app/views/InfoBar.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/public/app/views/InfoBar.js b/public/app/views/InfoBar.js index 3fae625..389199d 100644 --- a/public/app/views/InfoBar.js +++ b/public/app/views/InfoBar.js @@ -20,9 +20,6 @@ App.views.InfoBar = Ext.extend(Ext.Panel, { "" ], - //show: function() { - //this.update(infoBarPanel); - //} }; Ext.apply(this, { @@ -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); @@ -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);