Roo/bootstrap/panel/Tabs.js
authoredward <edward@roojs.com>
Thu, 7 Jun 2018 05:38:12 +0000 (13:38 +0800)
committeredward <edward@roojs.com>
Thu, 7 Jun 2018 05:38:12 +0000 (13:38 +0800)
Roo/bootstrap/panel/Tabs.js

index 95f2e0a..ec29d3a 100644 (file)
@@ -315,20 +315,25 @@ Roo.extend(Roo.bootstrap.panel.Tabs, Roo.util.Observable, {
         if(!tab){
             return null;
         }
-        if(tab == this.active || tab.disabled){
-            return tab;
-        }
-        var e = {};
-        this.fireEvent("beforetabchange", this, e, tab);
-        if(e.cancel !== true && !tab.disabled){
-            if(this.active){
-                this.active.hide();
+        
+        if(this.fireEvent("beforetabchange", this, e, tab) !== false){
+            if(tab == this.active || tab.disabled){
+                return tab;
             }
-            this.active = this.items[id];
-            this.active.show();
-            this.fireEvent("tabchange", this, this.active);
+//            var e = {};
+//            this.fireEvent("beforetabchange", this, e, tab);
+//            if(e.cancel !== true && !tab.disabled){
+                if(this.active){
+                    this.active.hide();
+                }
+                this.active = this.items[id];
+                this.active.show();
+                this.fireEvent("tabchange", this, this.active);
+//            }
+            return tab;
         }
-        return tab;
+        
+        
     },
 
     /**