</head>
<body onload="prettyPrint();">
<pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.2.1
- * Copyright(c) 2006-2010 Ext JS, Inc.
- * licensing@extjs.com
- * http://www.extjs.com/license
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
*/
<div id="cls-Ext.TabPanel"></div>/**
* @class Ext.TabPanel
// private
delegateUpdates : function(){
+ var rendered = this.rendered;
if(this.suspendUpdates){
return;
}
- if(this.resizeTabs && this.rendered){
+ if(this.resizeTabs && rendered){
this.autoSizeTabs();
}
- if(this.enableTabScroll && this.rendered){
+ if(this.enableTabScroll && rendered){
this.autoScrollTabs();
}
},
this.stack.add(item);
this.layout.setActiveItem(item);
+ // Need to do this here, since setting the active tab slightly changes the size
+ this.delegateUpdates();
if(this.scrolling){
this.scrollToTab(item, this.animScroll);
}
pos = this.getScrollPos(),
l = this.edge.getOffsetsTo(this.stripWrap)[0] + pos;
- if(!this.enableTabScroll || count < 1 || cw < 20){ // 20 to prevent display:none issues
+ if(!this.enableTabScroll || cw < 20){ // 20 to prevent display:none issues
return;
}
- if(l <= tw){
+ if(count == 0 || l <= tw){
+ // ensure the width is set if there's no tabs
wd.scrollLeft = 0;
wrap.setWidth(tw);
if(this.scrolling){