* @param {Roo.TabPanelItem} item The TabPanelItem to add
*/
addTabItem : function(item){
- Roo.log('Running addTabItem!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
- Roo.log(item);
this.items[item.id] = item;
this.items.push(item);
if(this.resizeTabs){
- Roo.log('resize tabs??');
item.setWidth(this.currentTabWidth || this.preferredTabWidth);
this.autoSizeTabs();
}else{
- Roo.log('no resize tabs??');
item.autoSize();
}
},
autoSizeTabs : function(){
var count = this.items.length;
var vcount = count - this.hiddenCount;
- if(!this.resizeTabs || count < 1 || vcount < 1 || this.updating) return;
+ if(!this.resizeTabs || count < 1 || vcount < 1 || this.updating) {
+ return;
+ }
var w = Math.max(this.el.getWidth() - this.cpad, 10);
var availWidth = Math.floor(w / vcount);
var b = this.stripBody;
setTabWidth : function(width){
this.currentTabWidth = width;
for(var i = 0, len = this.items.length; i < len; i++) {
- if(!this.items[i].isHidden())this.items[i].setWidth(width);
+ if(!this.items[i].isHidden()) {
+ this.items[i].setWidth(width);
+ }
}
},
autoSize : function(){
//this.el.beginMeasure();
this.textEl.setWidth(1);
- this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr"));
+ /*
+ * #2804 [new] Tabs in Roojs
+ * increase the width by 2-4 pixels to prevent the ellipssis showing in chrome
+ */
+ this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr") + 2);
//this.el.endMeasure();
},