roojs-bootstrap.js
[roojs1] / roojs-bootstrap-debug.js
index 14e6863..22c0d54 100644 (file)
@@ -10757,7 +10757,13 @@ Roo.bootstrap.ComboBox = function(config){
          * Fires when the remove value from the combobox array
             * @param {Roo.bootstrap.ComboBox} combo This combo box
             */
-        'remove' : true
+        'remove' : true,
+        /**
+         * @event specialfilter
+         * Fires when specialfilter
+            * @param {Roo.bootstrap.ComboBox} combo This combo box
+            */
+        'specialfilter' : true
         
     });
     
@@ -10806,6 +10812,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
      * mode = 'remote' or 'text' if mode = 'local')
      */
     displayField: undefined,
+    
     /**
      * @cfg {String} valueField The underlying data value name to bind to this CombBox (defaults to undefined if
      * mode = 'remote' or 'value' if mode = 'local'). 
@@ -10951,6 +10958,11 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
      */
     validClass : "has-success",
     
+    /**
+     * @cfg {Boolean} specialFilter (true|false) special filter default false
+     */
+    specialFilter : false,
+    
     //private
     addicon : false,
     editicon: false,
@@ -12062,6 +12074,13 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                     if(forceAll){
                         this.store.clearFilter();
                     }else{
+                        
+                        if(this.specialFilter){
+                            this.fireEvent('specialfilter', this);
+                            this.onLoad();
+                            return;
+                        }
+                        
                         this.store.filter(this.displayField, q);
                     }
                     this.onLoad();
@@ -12093,7 +12112,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         
         this.loadNext = false;
     },
-
+    
     // private
     getParams : function(q){
         var p = {};
@@ -14550,6 +14569,8 @@ Roo.extend(Roo.bootstrap.ProgressBar, Roo.bootstrap.Component,  {
  * @cfg {String} navId the navigation id (for use with navbars) - will be auto generated if it does not exist..
  * @cfg {Boolean} carousel true to make the group behave like a carousel
  * @cfg {Number} bullets show the panel pointer.. default 0
+ * @cfg {Boolena} autoslide (true|false) auto slide .. default false
+ * @cfg {Number} timer auto slide timer .. default 0 millisecond
  * 
  * @constructor
  * Create a new TabGroup
@@ -14571,7 +14592,10 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
     carousel : false,
     transition : false,
     bullets : 0,
-     
+    timer : 0,
+    autoslide : false,
+    slideFn : false,
+    
     getAutoCreate : function()
     {
         var cfg = Roo.apply({}, Roo.bootstrap.TabGroup.superclass.getAutoCreate.call(this));
@@ -14630,16 +14654,16 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
                     
                     _this.showPanel(ii);
                     
-                    Roo.each(_this.el.select('.bullet', true).elements, function(el){
-                        el.removeClass('selected');
-                    })
-                    
-                    t.addClass('selected');
-                    
                 }).createDelegate(this, [i, bullet], true));
                 
             }
         }
+        
+        if(this.autoslide){
+            this.slideFn = window.setInterval(function() {
+                _this.showPanelNext();
+            }, this.timer);
+        }
     },
     
     getChildContainer : function()
@@ -14722,6 +14746,10 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
             return false;
         }
         
+        if(this.bullets > 0){
+            this.setActiveBullet(this.indexOfPanel(pan));
+        }
+        
         if (this.carousel && typeof(Roo.get(document.body).dom.style.transition) != 'undefined') {
             
             this.transition = true;
@@ -14745,29 +14773,59 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
                 _this.transition = false;
                 
             }, this, { single:  true } );
+            
             return true;
         }
         
         cur.setActive(false);
         pan.setActive(true);
+        
         return true;
         
     },
     showPanelNext : function()
     {
         var i = this.indexOfPanel(this.getActivePanel());
-        if (i > this.tabs.length) {
+        
+        if (i >= this.tabs.length - 1 && !this.autoslide) {
             return;
         }
+        
+        if (i >= this.tabs.length - 1 && this.autoslide) {
+            i = -1;
+        }
+        
         this.showPanel(this.tabs[i+1]);
     },
+    
     showPanelPrev : function()
     {
         var i = this.indexOfPanel(this.getActivePanel());
-        if (i  < 1) {
+        
+        if (i  < 1 && !this.autoslide) {
             return;
         }
+        
+        if (i < 1 && this.autoslide) {
+            i = this.tabs.length;
+        }
+        
         this.showPanel(this.tabs[i-1]);
+    },
+    
+    setActiveBullet : function(i)
+    {
+        Roo.each(this.el.select('.bullet', true).elements, function(el){
+            el.removeClass('selected');
+        });
+
+        var bullet = this.el.select('.bullet-' + i, true).first();
+        
+        if(!bullet){
+            return;
+        }
+        
+        bullet.addClass('selected');
     }
     
     
@@ -14893,7 +14951,14 @@ Roo.extend(Roo.bootstrap.TabPanel, Roo.bootstrap.Component,  {
             var tg = Roo.bootstrap.TabGroup.get(this.navId);
             Roo.log(['register', tg, this]);
             tg.register(this);
+            
+            var i = tg.tabs.length - 1;
+            
+            if(this.active && tg.bullets > 0 && i < tg.bullets){
+                tg.setActiveBullet(i);
+            }
         }
+        
     },
     
     
@@ -14920,6 +14985,7 @@ Roo.extend(Roo.bootstrap.TabPanel, Roo.bootstrap.Component,  {
         } else  if (!this.el.hasClass('active')) {
             this.el.addClass('active');
         }
+        
         this.fireEvent('changed', this, state);
     }