roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Tue, 22 Jul 2014 08:17:37 +0000 (16:17 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 22 Jul 2014 08:17:37 +0000 (16:17 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index 5592037..2011d03 100644 (file)
@@ -2032,6 +2032,8 @@ Roo.apply(Roo.bootstrap.Modal,  {
 
 Roo.bootstrap.Navbar = function(config){
     Roo.bootstrap.Navbar.superclass.constructor.call(this, config);
+   
+    
 };
 
 Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
@@ -2049,6 +2051,10 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
     main : false,
     loadMask : false,
     
+    
+    // private
+    navItems : false,
+    
     getAutoCreate : function(){
         var cfg = {
             cls : 'navbar'
@@ -2213,9 +2219,13 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
     {
         this.maskEl.hide();
     }
-   
+    
+    
+    
 });
 
+
+
  
 
  /*
@@ -2232,6 +2242,8 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
  * @cfg {String} align left | right
  * @cfg {Boolean} inverse false | true
  * @cfg {String} type (nav|pills|tab) default nav
+ * @cfg {String} navId - reference Id for navbar.
+
  * 
  * @constructor
  * Create a new nav group
@@ -2240,6 +2252,19 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
 
 Roo.bootstrap.NavGroup = function(config){
     Roo.bootstrap.NavGroup.superclass.constructor.call(this, config);
+    this.navItems = [];
+    Roo.bootstrap.NavGroup.register(this);
+     this.addEvents({
+        /**
+            * @event changed
+            * Fires when the active item changes
+            * @param {Roo.bootstrap.NavGroup} this
+            * @param {Roo.bootstrap.Navbar.Item} item The item selected
+            * @param {Roo.bootstrap.Navbar.Item} item The previously selected item 
+         */
+        'changed': true
+     });
+    
 };
 
 Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
@@ -2248,8 +2273,13 @@ Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
     inverse: false,
     form: false,
     type: 'nav',
+    navId : '',
+    // private
     
-    getAutoCreate : function(){
+    navItems : false,
+    
+    getAutoCreate : function()
+    {
         var cfg = Roo.apply({}, Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));
         
         cfg = {
@@ -2299,11 +2329,53 @@ Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
         
         
         return cfg;
+    },
+    
+    setActiveItem : function(item)
+    {
+        var prev = false;
+        Roo.each(this.navItems, function(v){
+            if (v.isActive()) {
+                v.setActive(false, true);
+                prev = v;
+                
+            }
+            
+        });
+
+        item.el.setActive('active', true);
+        this.fireEvent('changed', this, item, prev);
+        
+        
+    },
+    
+    
+    register : function(item)
+    {
+       this.navItems.push( item);
+       item.navId = this.navId;
+    
     }
-   
+    
 });
 
  
+Roo.apply(Roo.bootstrap.NavGroup, {
+    
+    groups: {},
+    
+    register : function(navgrp)
+    {
+       this.groups[navgrp.navId] = navgrp;
+       
+    },
+    get: function(navId) {
+        return this.groups[navId];
+    }
+    
+    
+    
+});
 
  /*
  * - LGPL
@@ -2321,8 +2393,9 @@ Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
  * @cfg {String} badge text inside badge
  * @cfg {String} glyphicon name of glyphicon
  * @cfg {String} icon name of font awesome icon
- * @cfg {Boolena} active Is item active
+ * @cfg {Boolean} active Is item active
  * @cfg {Boolean} preventDefault (true | false) default false
+ * @cfg {String} tabId the tab that this item activates.
   
  * @constructor
  * Create a new Navbar Button
@@ -2337,8 +2410,17 @@ Roo.bootstrap.Navbar.Item = function(config){
          * The raw click event for the entire grid.
          * @param {Roo.EventObject} e
          */
-        "click" : true
+        "click" : true,
+        /**
+           * @event changed
+           * Fires when the active item active state changes
+           * @param {Roo.bootstrap.Navbar.Item} this
+           * @param {boolean} state the new state
+            
+         */
+        'changed': true
     });
+   
 };
 
 Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component,  {
@@ -2348,9 +2430,9 @@ Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component,  {
     badge: '',
     icon: false,
     glyphicon: false,
-    icon: false,
     active: false,
     preventDefault : false,
+    tabId : false,
     
     getAutoCreate : function(){
         
@@ -2461,6 +2543,8 @@ Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component,  {
        // Roo.log('init events?');
        // Roo.log(this.el.dom);
         this.el.select('a',true).on('click', this.onClick, this);
+       // at this point parent should be available..
+       this.parent().register(this);
     },
     
     onClick : function(e)
@@ -2474,29 +2558,34 @@ Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component,  {
         };
         
         if (['tabs','pills'].indexOf(this.parent().type)!==-1) {
-            this.onTabsClick(e);
+            if (typeof(this.parent().setActiveItem) !== 'undefined') {
+               this.parent().setActiveItem(this);
+           }
+           
+           
+           
         } 
     },
     
-    onTabsClick : function(e)
+    isActive: function () {
+       return this.active
+    },
+    setActive : function(state, fire)
     {
-        Roo.each(this.parent().el.select('.active',true).elements, function(v){
-            v.removeClass('active');
-        })
-
-        this.el.addClass('active');
-
-        if(this.href && this.href.substring(0,1) == '#'){
-            var tab = Roo.select('[tabId=' + this.href + ']', true).first();
-
-            Roo.each(tab.findParent('.tab-content', 0, true).select('.active', true).elements, function(v){
-                v.removeClass('active');
-            });
-
-            tab.addClass('active');
-        }
+       this.active = state;
+       if (!state ) {
+           this.el.removeClass('active');
+       } else if (!this.hasClass('active')) {
+           this.addClass('active');
+       }
+       if (fire) {
+           this.fireEvent('changed', this, state);
+       }
+       
+       
     }
-   
+     // this should not be here...
 });
  
 
@@ -10935,6 +11024,7 @@ Roo.extend(Roo.bootstrap.ProgressBar, Roo.bootstrap.Component,  {
  * @cfg {Boolean} active panel active
  * @cfg {String} html panel content
  * @cfg {String} tabId tab relate id
+ * @cfg {String} navId The navbar which triggers show hide
  * 
  * 
  * @constructor
@@ -10951,6 +11041,7 @@ Roo.extend(Roo.bootstrap.TabPanel, Roo.bootstrap.Component,  {
     active: false,
     html: false,
     tabId: false,
+    navId : false,
     
     getAutoCreate : function(){
         var cfg = {
@@ -10968,9 +11059,36 @@ Roo.extend(Roo.bootstrap.TabPanel, Roo.bootstrap.Component,  {
         }
         
         return cfg;
+    },
+    onRender : function(ct, position)
+    {
+       // Roo.log("Call onRender: " + this.xtype);
+        
+        Roo.bootstrap.TabPanel.superclass.onRender.call(this, ct, position);
+        
+        if (this.navId && this.tabId) {
+            var item = Roo.bootstrap.NavGroup.get(navId).getTabItem(tabId).
+            item.on('changed', function(item, state) {
+                this.setActive(state);
+            }, this);
+        }
+        
+    },
+    setActive: function(state)
+    {
+        this.active = state;
+        if (!state) {
+            this.el.removeClass('active');
+            
+        } else  if (!this.el.hasClass('active')) {
+            this.el.addClass('active');
+        }
+        this.fireEvent('changed', this, state);
     }
-   
+    
+    
 });
 
  
 
index 68e2aa1..7430894 100644 (file)
@@ -52,19 +52,18 @@ this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true
 this.items=C;this.initEvents();},getAutoCreate:function(){var A={cls:'modal-body',html:this.html||''};return modal={cls:"modal fade",cn:[{cls:"modal-dialog",cn:[{cls:"modal-content",cn:[{cls:'modal-header',cn:[{tag:'button',cls:'close',html:'&times'},{tag:'h4',cls:'modal-title',html:this.title}]},A,{cls:'modal-footer'}]}]}]};},getChildContainer:function(){return this.el.select('.modal-body',true).first();},getButtonContainer:function(){return this.el.select('.modal-footer',true).first();},initEvents:function(){this.el.select('.modal-header .close').on('click',this.hide,this);},show:function(){if(!this.rendered){this.render();}
 this.el.addClass('on');this.el.removeClass('fade');this.el.setStyle('display','block');Roo.get(document.body).addClass("x-body-masked");this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.maskEl.show();this.el.setStyle('zIndex','10001');this.fireEvent('show',this);},hide:function(){Roo.log('Modal hide?!');this.maskEl.hide();Roo.get(document.body).removeClass("x-body-masked");this.el.removeClass('on');this.el.addClass('fade');this.el.setStyle('display','none');this.fireEvent('hide',this);},onButtonClick:function(A,e){this.fireEvent('btnclick',A.name,e);}});Roo.apply(Roo.bootstrap.Modal,{OK:[{name:'ok',weight:'primary',html:'OK'}],YESNO:[{name:'no',html:'No'},{name:'yes',weight:'primary',html:'Yes'}],OKCANCEL:[{name:'cancel',html:'Cancel'},{name:'ok',weight:'primary',html:'OK'}],YESNOCANCEL:[{name:'yes',weight:'primary',html:'Yes'},{name:'no',html:'No'},{name:'cancel',html:'Cancel'}]});
 //Roo/bootstrap/Navbar.js
-Roo.bootstrap.Navbar=function(A){Roo.bootstrap.Navbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Navbar,Roo.bootstrap.Component,{sidebar:false,bar:false,brand:'',inverse:false,position:'',align:false,type:'nav',arrangement:'',brand_href:false,main:false,loadMask:false,getAutoCreate:function(){var A={cls:'navbar'};if(this.sidebar===true){A={tag:'div',cls:'sidebar-nav'};return A;}if(this.bar===true){A={tag:'nav',cls:'navbar',role:'navigation',cn:[{tag:'div',cls:'navbar-header',cn:[{tag:'button',type:'button',cls:'navbar-toggle','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'},{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]}]},{tag:'div',cls:'collapse navbar-collapse'}]};A.cls+=this.inverse?' navbar-inverse':' navbar-default';if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position;A.tag=this.position=='fixed-bottom'?'footer':'header';}if(this.brand!==''){A.cn[0].cn.push({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav';}return A;}else if(this.bar===false){}else {Roo.log('Property \'bar\' in of Navbar must be either true or false')}
+Roo.bootstrap.Navbar=function(A){Roo.bootstrap.Navbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Navbar,Roo.bootstrap.Component,{sidebar:false,bar:false,brand:'',inverse:false,position:'',align:false,type:'nav',arrangement:'',brand_href:false,main:false,loadMask:false,navItems:false,getAutoCreate:function(){var A={cls:'navbar'};if(this.sidebar===true){A={tag:'div',cls:'sidebar-nav'};return A;}if(this.bar===true){A={tag:'nav',cls:'navbar',role:'navigation',cn:[{tag:'div',cls:'navbar-header',cn:[{tag:'button',type:'button',cls:'navbar-toggle','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'},{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]}]},{tag:'div',cls:'collapse navbar-collapse'}]};A.cls+=this.inverse?' navbar-inverse':' navbar-default';if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position;A.tag=this.position=='fixed-bottom'?'footer':'header';}if(this.brand!==''){A.cn[0].cn.push({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav';}return A;}else if(this.bar===false){}else {Roo.log('Property \'bar\' in of Navbar must be either true or false')}
 A.cn=[{cls:'nav',tag:'ul'}];if(['tabs','pills'].indexOf(this.type)!==-1){A.cn[0].cls+=' nav-'+this.type}else {if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}
 A.cn[0].cls+=' navbar-nav'}if(['stacked','justified'].indexOf(this.arrangement)!==-1){A.cn[0].cls+=' nav-'+this.arrangement;}if(this.align==='right'){A.cn[0].cls+=' navbar-right';}if(this.inverse){A.cls+=' navbar-inverse';}return A;},initEvents:function(){this.el.select('.navbar-toggle',true).on('click',function(){this.el.select('.navbar-collapse',true).toggleClass('in');},this);var A={tag:"div",cls:"x-dlg-mask"}
 this.maskEl=Roo.DomHelper.append(this.el,A,true);var B=this.el.getSize();this.maskEl.setSize(B.width,B.height);this.maskEl.enableDisplayMode("block");this.maskEl.hide();if(this.loadMask){this.maskEl.show();}},getChildContainer:function(){if(this.bar===true){return this.el.select('.collapse',true).first();}return this.el;},mask:function(){this.maskEl.show();},unmask:function(){this.maskEl.hide();}});
 //Roo/bootstrap/NavGroup.js
-Roo.bootstrap.NavGroup=function(A){Roo.bootstrap.NavGroup.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavGroup,Roo.bootstrap.Component,{align:'',inverse:false,form:false,type:'nav',getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(['tabs','pills'].indexOf(this.type)!==-1){A.cls+=' nav-'+this.type}else {if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}
-A.cls+=' navbar-nav'}if(this.parent().sidebar===true){A={tag:'ul',cls:'dashboard-menu'};return A;}if(this.form===true){A={tag:'form',cls:'navbar-form'};if(this.align==='right'){A.cls+=' navbar-right';}else {A.cls+=' navbar-left';}}if(this.align==='right'){A.cls+=' navbar-right';}if(this.inverse){A.cls+=' navbar-inverse';}return A;}});
+Roo.bootstrap.NavGroup=function(A){Roo.bootstrap.NavGroup.superclass.constructor.call(this,A);this.navItems=[];Roo.bootstrap.NavGroup.register(this);this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.NavGroup,Roo.bootstrap.Component,{align:'',inverse:false,form:false,type:'nav',navId:'',navItems:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(['tabs','pills'].indexOf(this.type)!==-1){A.cls+=' nav-'+this.type}else {if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}
+A.cls+=' navbar-nav'}if(this.parent().sidebar===true){A={tag:'ul',cls:'dashboard-menu'};return A;}if(this.form===true){A={tag:'form',cls:'navbar-form'};if(this.align==='right'){A.cls+=' navbar-right';}else {A.cls+=' navbar-left';}}if(this.align==='right'){A.cls+=' navbar-right';}if(this.inverse){A.cls+=' navbar-inverse';}return A;},setActiveItem:function(A){var B=false;Roo.each(this.navItems,function(v){if(v.isActive()){v.setActive(false,true);B=v;}});A.el.setActive('active',true);this.fireEvent('changed',this,A,B);},register:function(A){this.navItems.push(A);A.navId=this.navId;}});Roo.apply(Roo.bootstrap.NavGroup,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){return this.groups[A];}});
 //Roo/bootstrap/Navbar/Item.js
-Roo.bootstrap.Navbar.Item=function(A){Roo.bootstrap.Navbar.Item.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Navbar.Item,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,glyphicon:false,icon:false,active:false,preventDefault:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.Navbar.Item.superclass.getAutoCreate.call(this));if(this.parent().parent().sidebar===true){A={tag:'li',cls:'',cn:[{tag:'p',cls:''}]};if(this.html){A.cn[0].html=this.html;}if(this.active){this.cls+=' active';}if(this.menu){A.cn[0].cls+=' dropdown-toggle';A.cn[0].html=(A.cn[0].html||this.html)+'<span class="glyphicon glyphicon-chevron-down"></span>';}if(this.href){A.cn[0].tag='a',A.cn[0].href=this.href;}if(this.glyphicon){A.cn[0].html='<i class="glyphicon glyphicon-'+this.glyphicon+'"></i><span>'+A.cn[0].html||this.html+'</span>'}if(this.icon){A.cn[0].html='<i class="'+this.icon+'"></i><span>'+A.cn[0].html||this.html+'</span>'}return A;}
+Roo.bootstrap.Navbar.Item=function(A){Roo.bootstrap.Navbar.Item.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true});};Roo.extend(Roo.bootstrap.Navbar.Item,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,glyphicon:false,active:false,preventDefault:false,tabId:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.Navbar.Item.superclass.getAutoCreate.call(this));if(this.parent().parent().sidebar===true){A={tag:'li',cls:'',cn:[{tag:'p',cls:''}]};if(this.html){A.cn[0].html=this.html;}if(this.active){this.cls+=' active';}if(this.menu){A.cn[0].cls+=' dropdown-toggle';A.cn[0].html=(A.cn[0].html||this.html)+'<span class="glyphicon glyphicon-chevron-down"></span>';}if(this.href){A.cn[0].tag='a',A.cn[0].href=this.href;}if(this.glyphicon){A.cn[0].html='<i class="glyphicon glyphicon-'+this.glyphicon+'"></i><span>'+A.cn[0].html||this.html+'</span>'}if(this.icon){A.cn[0].html='<i class="'+this.icon+'"></i><span>'+A.cn[0].html||this.html+'</span>'}return A;}
 A={tag:'li',cls:'nav-item'};if(this.active){A.cls=typeof(A.cls)=='undefined'?'active':A.cls+' active';}
 A.cn=[{tag:'p',html:'Text'}];if(this.glyphicon){if(A.html){A.html=' '+this.html};A.cn=[{tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon}];}
-A.cn[0].html=this.html||A.cn[0].html;if(this.menu){A.cn[0].tag='a';A.cn[0].href='#';A.cn[0].html+=" <span class='caret'></span>";}else {A.cn[0].tag='a';A.cn[0].href=this.href||'#';A.cn[0].html=this.html;}if(this.badge!==''){A.cn[0].cn=[A.cn[0].html+' ',{tag:'span',cls:'badge',html:this.badge}];A.cn[0].html=''}if(this.icon){A.cn[0].html='<i class="'+this.icon+'"></i><span>'+A.cn[0].html||this.html+'</span>'}return A;},initEvents:function(){this.el.select('a',true).on('click',this.onClick,this);},onClick:function(e){if(this.preventDefault){e.preventDefault();}if(this.fireEvent('click',this,e)===false){return;};if(['tabs','pills'].indexOf(this.parent().type)!==-1){this.onTabsClick(e);}},onTabsClick:function(e){Roo.each(this.parent().el.select('.active',true).elements,function(v){v.removeClass('active');})
-this.el.addClass('active');if(this.href&&this.href.substring(0,1)=='#'){var A=Roo.select('[tabId='+this.href+']',true).first();Roo.each(A.findParent('.tab-content',0,true).select('.active',true).elements,function(v){v.removeClass('active');});A.addClass('active');}}});
+A.cn[0].html=this.html||A.cn[0].html;if(this.menu){A.cn[0].tag='a';A.cn[0].href='#';A.cn[0].html+=" <span class='caret'></span>";}else {A.cn[0].tag='a';A.cn[0].href=this.href||'#';A.cn[0].html=this.html;}if(this.badge!==''){A.cn[0].cn=[A.cn[0].html+' ',{tag:'span',cls:'badge',html:this.badge}];A.cn[0].html=''}if(this.icon){A.cn[0].html='<i class="'+this.icon+'"></i><span>'+A.cn[0].html||this.html+'</span>'}return A;},initEvents:function(){this.el.select('a',true).on('click',this.onClick,this);this.parent().register(this);},onClick:function(e){if(this.preventDefault){e.preventDefault();}if(this.fireEvent('click',this,e)===false){return;};if(['tabs','pills'].indexOf(this.parent().type)!==-1){if(typeof(this.parent().setActiveItem)!=='undefined'){this.parent().setActiveItem(this);}}},isActive:function(){return this.active},setActive:function(A,B){this.active=A;if(!A){this.el.removeClass('active');}else if(!this.hasClass('active')){this.addClass('active');}if(B){this.fireEvent('changed',this,A);}}});
 //Roo/bootstrap/Row.js
 Roo.bootstrap.Row=function(A){Roo.bootstrap.Row.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Row,Roo.bootstrap.Component,{getAutoCreate:function(){return {cls:'row clearfix'};}});
 //Roo/bootstrap/Element.js
@@ -253,7 +252,8 @@ Roo.bootstrap.Progress=function(A){Roo.bootstrap.Progress.superclass.constructor
 //Roo/bootstrap/ProgressBar.js
 Roo.bootstrap.ProgressBar=function(A){Roo.bootstrap.ProgressBar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.ProgressBar,Roo.bootstrap.Component,{aria_valuenow:0,aria_valuemin:0,aria_valuemax:100,label:false,panel:false,role:false,sr_only:false,getAutoCreate:function(){var A={tag:'div',cls:'progress-bar',style:'width:'+Math.ceil((this.aria_valuenow/this.aria_valuemax)*100)+'%'};if(this.sr_only){A.cn={tag:'span',cls:'sr-only',html:this.sr_only}}if(this.role){A.role=this.role;}if(this.aria_valuenow){A['aria-valuenow']=this.aria_valuenow;}if(this.aria_valuemin){A['aria-valuemin']=this.aria_valuemin;}if(this.aria_valuemax){A['aria-valuemax']=this.aria_valuemax;}if(this.label&&!this.sr_only){A.html=this.label;}if(this.panel){A.cls+=' progress-bar-'+this.panel;}return A;},update:function(A){this.aria_valuenow=A;this.el.setStyle('width',Math.ceil((this.aria_valuenow/this.aria_valuemax)*100)+'%');}});
 //Roo/bootstrap/TabPanel.js
-Roo.bootstrap.TabPanel=function(A){Roo.bootstrap.TabPanel.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TabPanel,Roo.bootstrap.Component,{active:false,html:false,tabId:false,getAutoCreate:function(){var A={tag:'div',cls:'tab-pane',html:this.html||''};if(this.active){A.cls+=' active';}if(this.tabId){A.tabId=this.tabId;}return A;}});
+Roo.bootstrap.TabPanel=function(A){Roo.bootstrap.TabPanel.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TabPanel,Roo.bootstrap.Component,{active:false,html:false,tabId:false,navId:false,getAutoCreate:function(){var A={tag:'div',cls:'tab-pane',html:this.html||''};if(this.active){A.cls+=' active';}if(this.tabId){A.tabId=this.tabId;}return A;},onRender:function(ct,A){Roo.bootstrap.TabPanel.superclass.onRender.call(this,ct,A);if(this.navId&&this.tabId){var B=Roo.bootstrap.NavGroup.get(navId).getTabItem(tabId).item.on('changed',function(C,D){this.setActive(D);},this);}},setActive:function(A){this.active=A;if(!A){this.el.removeClass('active');}else if(!this.el.hasClass('active')){this.el.addClass('active');}
+this.fireEvent('changed',this,A);}});
 //Roo/bootstrap/DateField.js
 Roo.bootstrap.DateField=function(A){Roo.bootstrap.DateField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.DateField,Roo.bootstrap.Input,{format:"m/d/y",altFormats:"m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d",weekStart:0,viewMode:'',minViewMode:'',todayHighlight:false,todayBtn:false,language:'en',keyboardNavigation:true,calendarWeeks:false,startDate:-Infinity,endDate:Infinity,daysOfWeekDisabled:[],_events:[],UTCDate:function(){return new Date(Date.UTC.apply(Date,arguments));},UTCToday:function(){var A=new Date();return this.UTCDate(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate());},getDate:function(){var d=this.getUTCDate();return new Date(d.getTime()+(d.getTimezoneOffset()*60000));},getUTCDate:function(){return this.date;},setDate:function(d){this.setUTCDate(new Date(d.getTime()-(d.getTimezoneOffset()*60000)));},setUTCDate:function(d){this.date=d;this.setValue(this.formatDate(this.date));},onRender:function(ct,A){Roo.bootstrap.DateField.superclass.onRender.call(this,ct,A);this.language=this.language||'en';this.language=this.language in Roo.bootstrap.DateField.dates?this.language:this.language.split('-')[0];this.language=this.language in Roo.bootstrap.DateField.dates?this.language:"en";this.isRTL=Roo.bootstrap.DateField.dates[this.language].rtl||false;this.format=this.format||'m/d/y';this.isInline=false;this.isInput=true;this.component=this.el.select('.add-on',true).first()||false;this.component=(this.component&&this.component.length===0)?false:this.component;this.hasInput=this.component&&this.inputEL().length;if(typeof(this.minViewMode==='string')){switch(this.minViewMode){case 'months':this.minViewMode=1;break;case 'years':this.minViewMode=2;break;default:this.minViewMode=0;break;}}if(typeof(this.viewMode==='string')){switch(this.viewMode){case 'months':this.viewMode=1;break;case 'years':this.viewMode=2;break;default:this.viewMode=0;break;}}
 this.el.select('>.input-group',true).first().createChild(Roo.bootstrap.DateField.template);this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this);this.picker().on('click',this.onClick,this);this.picker().addClass('datepicker-dropdown');this.startViewMode=this.viewMode;Roo.each(this.picker().select('tfoot th.today',true).elements,function(v){if(!this.calendarWeeks){v.remove();return;};v.dom.innerHTML=Roo.bootstrap.DateField.dates[this.language].today