Roo/bootstrap/panel/Tabs.js
authorAlan Knowles <alan@roojs.com>
Fri, 30 Nov 2018 05:02:03 +0000 (13:02 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 30 Nov 2018 05:02:03 +0000 (13:02 +0800)
Roo/bootstrap/panel/Tabs.js

index 24d7a7e..8be3d08 100644 (file)
@@ -230,6 +230,7 @@ Roo.extend(Roo.bootstrap.panel.Tabs, Roo.util.Observable, {
     {
         this.items[item.id] = item;
         this.items.push(item);
+        
       //  if(this.resizeTabs){
     //       item.setWidth(this.currentTabWidth || this.preferredTabWidth);
   //         this.autoSizeTabs();
@@ -378,12 +379,17 @@ Roo.extend(Roo.bootstrap.panel.Tabs, Roo.util.Observable, {
     /**
      * Manual call to resize the tabs (if {@link #resizeTabs} is false this does nothing)
      */
-    autoSizeTabs : function(){
+    autoSizeTabs : function()
+    {
         var count = this.items.length;
         var vcount = count - this.hiddenCount;
         if(!this.resizeTabs || count < 1 || vcount < 1 || this.updating) {
             return;
         }
+        if (vcount < 2) {
+            this.stripEl.hide();
+        }
+        
         var w = Math.max(this.el.getWidth() - this.cpad, 10);
         var availWidth = Math.floor(w / vcount);
         var b = this.stripBody;