PDA

View Full Version : tabPanel.activate() with no change



rgraff
23 Oct 2006, 9:00 AM
If you call tabPanel.activate() on the current tab, it will fire the onTabChange event even though there was no change.

Should be a simple fix....



/** * Activate a TabPanelItem. The currently active will be deactivated.
* @param {String} id The id of the TabPanelItem to activate.
*/ activate : function(id){
var tab = this.items[id];
if (tab == this.active) { // Added
return; // these
} // lines
if(!tab.disabled){
if(this.active){
this.active.hide();
}
this.active = tab; // changed from this.active = this.items[id]; a little shorter.
this.active.show();
this.onTabChange.fireDirect(this, this.active);
}
},


-Robert

jack.slocum
23 Oct 2006, 1:04 PM
I added them, thanks for reporting this.