sync
authorAlan Knowles <alan@roojs.com>
Thu, 10 Aug 2017 05:20:42 +0000 (13:20 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 10 Aug 2017 05:20:42 +0000 (13:20 +0800)
Roo/bootstrap/DateField.js
Roo/bootstrap/Modal.js
Roo/bootstrap/layout/Border.js
Roo/bootstrap/layout/Region.js
Roo/bootstrap/panel/Tabs.js
examples/bootstrap/nested-dialog.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index a626a81..0a8767a 100644 (file)
@@ -974,7 +974,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         
         
         return true;
-    },
+    }
    
 });
 
index 5746ef6..707bcfb 100644 (file)
@@ -257,8 +257,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),  Roo.lib.Dom.getViewHeight(true));
         if (this.fitwindow) {
             var w = this.width || Roo.lib.Dom.getViewportWidth(true) - 30;
-            var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 30;
-            this.setSize(w,h)
+            var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 60;
+            this.setSize(w,h);
         }
     },
     
@@ -299,13 +299,15 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         this.el.setStyle('zIndex', '10001');
        
         this.fireEvent('show', this);
-        this.items.forEach(function(e) {
-            e.layout ? e.layout() : false;
-                
-        });
-        this.resize();
         
+        this.resize();
         
+        (function () {
+            this.items.forEach( function(e) {
+                e.layout ? e.layout() : false;
+                    
+            });
+        }).defer(100,this);
         
     },
     hide : function()
index c6ea1ec..d43e259 100644 (file)
@@ -77,6 +77,14 @@ Roo.extend(Roo.bootstrap.layout.Border, Roo.bootstrap.layout.Manager, {
         if(this.updating) {
             return;
         }
+        
+        // render all the rebions if they have not been done alreayd?
+        Roo.each(Roo.bootstrap.layout.Border.regions, function(region) {
+            if(this.regions[region] && !this.regions[region].bodyEl){
+                this.regions[region].onRender(this.el)
+            }
+        },this);
+        
         var size = this.getViewSize();
         var w = size.width;
         var h = size.height;
index 7b6a71f..a3d58ad 100644 (file)
@@ -68,12 +68,13 @@ Roo.bootstrap.layout.Region = function(config)
      
     this.visible = true;
     this.collapsed = false;
+    this.unrendered_panels = [];
 };
 
 Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
 
     position: '', // set by wrapper (eg. north/south etc..)
-
+    unrendered_panels : null,  // unrendered panels.
     createBody : function(){
         /** This region's body element 
         * @type Roo.Element */
@@ -143,6 +144,15 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
         if(this.config.hidden){
             this.hide();
         }
+        
+        if (this.unrendered_panels && this.unrendered_panels.length) {
+            for (var i =0;i< this.unrendered_panels.length; i++) {
+                this.add(this.unrendered_panels[i]);
+            }
+            this.unrendered_panels = null;
+            
+        }
+        
     },
     
     applyConfig : function(c)
@@ -255,6 +265,10 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
 */
     updateBox : function(box)
     {
+        if (!this.bodyEl) {
+            return; // not rendered yet..
+        }
+        
         this.box = box;
         if(!this.collapsed){
             this.el.dom.style.left = box.x + "px";
@@ -456,7 +470,8 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
     initPanelAsTab : function(panel){
         var ti = this.tabs.addTab(
                     panel.getEl().id,
-                    panel.getTitle(), null,
+                    panel.getTitle(),
+                    null,
                     this.config.closeOnTab && panel.isClosable()
             );
         if(panel.tabTip !== undefined){
@@ -563,20 +578,33 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
      * @param {ContentPanel...} panel The ContentPanel(s) to add (you can pass more than one)
      * @return {Roo.ContentPanel} The panel added (if only one was added; null otherwise)
      */
-    add : function(panel){
+    add : function(panel)
+    {
         if(arguments.length > 1){
             for(var i = 0, len = arguments.length; i < len; i++) {
                 this.add(arguments[i]);
             }
             return null;
         }
+        
+        // if we have not been rendered yet, then we can not really do much of this..
+        if (!this.bodyEl) {
+            this.unrendered_panels.push(panel);
+            return panel;
+        }
+        
+        
+        
+        
         if(this.hasPanel(panel)){
             this.showPanel(panel);
             return panel;
         }
         panel.setRegion(this);
         this.panels.add(panel);
-        if(this.panels.getCount() == 1 && !this.config.alwaysShowTabs){
+       /* if(this.panels.getCount() == 1 && !this.config.alwaysShowTabs){
+            // sinle panel - no tab...?? would it not be better to render it with the tabs,
+            // and hide them... ???
             this.bodyEl.dom.appendChild(panel.getEl().dom);
             if(panel.background !== true){
                 this.setActivePanel(panel);
@@ -584,6 +612,7 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
             this.fireEvent("paneladded", this, panel);
             return panel;
         }
+        */
         if(!this.tabs){
             this.initTabs();
         }else{
index 9928ae8..59ca5ab 100644 (file)
@@ -479,8 +479,12 @@ Roo.extend(Roo.bootstrap.panel.Tabs, Roo.util.Observable, {
     createStripElements :  function(stripEl, text, closable)
     {
         var td = document.createElement("li"); // was td..
-        stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
-        //stripEl.appendChild(td);
+        
+        
+        //stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
+        
+        
+        stripEl.appendChild(td);
         /*if(closable){
             td.className = "x-tabs-closable";
             if(!this.closeTpl){
index 308686f..f51bda0 100644 (file)
@@ -69,7 +69,7 @@ Example.NestedDialog = {
                         {
                             xtype : 'Content',
                             xns: Roo.bootstrap.panel,
-                            title : "Title center" ,
+                            title : "Title center 1" ,
                             fitToFrame:true,
                             closable:false,
                             region : 'center',
index 5f829f0..670b964 100644 (file)
@@ -2456,7 +2456,7 @@ Roo.extend(Roo.bootstrap.MenuSeparator, Roo.bootstrap.Component,  {
  * @cfg {String} buttonPosition (left|right|center) default right
  * @cfg {Boolean} animate default true
  * @cfg {Boolean} allow_close default true
- * @cfg {Boolean} fitwindow default true
+ * @cfg {Boolean} fitwindow default false
  * @cfg {String} size (sm|lg) default empty
  * 
  * 
@@ -2698,8 +2698,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),  Roo.lib.Dom.getViewHeight(true));
         if (this.fitwindow) {
             var w = this.width || Roo.lib.Dom.getViewportWidth(true) - 30;
-            var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 30;
-            this.setSize(w,h)
+            var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 60;
+            this.setSize(w,h);
         }
     },
     
@@ -2740,13 +2740,15 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         this.el.setStyle('zIndex', '10001');
        
         this.fireEvent('show', this);
-        this.items.forEach(function(e) {
-            e.layout ? e.layout() : false;
-                
-        });
-        this.resize();
         
+        this.resize();
         
+        (function () {
+            this.items.forEach( function(e) {
+                e.layout ? e.layout() : false;
+                    
+            });
+        }).defer(100,this);
         
     },
     hide : function()
@@ -8535,6 +8537,8 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         }
         if(this.maskRe || (this.vtype && this.disableKeyFilter !== true && (this.maskRe = Roo.form.VTypes[this.vtype+'Mask']))){
             this.inputEl().on("keypress", this.filterKeys, this);
+        } else {
+            this.inputEl().relayEvent('keypress', this);
         }
        /* if(this.grow){
             this.el.on("keyup", this.onKeyUp,  this, {buffer:50});
@@ -17329,7 +17333,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         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;
+        this.hasInput = this.component && this.inputEl().length;
         
         if (typeof(this.minViewMode === 'string')) {
             switch (this.minViewMode) {
@@ -18108,6 +18112,54 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
     remove: function() 
     {
         this.picker().remove();
+    },
+    
+    validateValue : function(value)
+    {
+        if(value.length < 1)  {
+            if(this.allowBlank){
+                return true;
+            }
+            return false;
+        }
+        
+        if(value.length < this.minLength){
+            return false;
+        }
+        if(value.length > this.maxLength){
+            return false;
+        }
+        if(this.vtype){
+            var vt = Roo.form.VTypes;
+            if(!vt[this.vtype](value, this)){
+                return false;
+            }
+        }
+        if(typeof this.validator == "function"){
+            var msg = this.validator(value);
+            if(msg !== true){
+                return false;
+            }
+        }
+        
+        if(this.regex && !this.regex.test(value)){
+            return false;
+        }
+        
+        if(typeof(this.parseDate(value)) == 'undefined'){
+            return false;
+        }
+        
+        if (this.endDate !== Infinity && this.parseDate(value).getTime() > this.endDate.getTime()) {
+            return false;
+        }      
+        
+        if (this.startDate !== -Infinity && this.parseDate(value).getTime() < this.startDate.getTime()) {
+            return false;
+        } 
+        
+        
+        return true;
     }
    
 });
@@ -31704,6 +31756,14 @@ Roo.extend(Roo.bootstrap.layout.Border, Roo.bootstrap.layout.Manager, {
         if(this.updating) {
             return;
         }
+        
+        // render all the rebions if they have not been done alreayd?
+        Roo.each(Roo.bootstrap.layout.Border.regions, function(region) {
+            if(this.regions[region] && !this.regions[region].bodyEl){
+                this.regions[region].onRender(this.el)
+            }
+        },this);
+        
         var size = this.getViewSize();
         var w = size.width;
         var h = size.height;
@@ -32484,12 +32544,13 @@ Roo.bootstrap.layout.Region = function(config)
      
     this.visible = true;
     this.collapsed = false;
+    this.unrendered_panels = [];
 };
 
 Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
 
     position: '', // set by wrapper (eg. north/south etc..)
-
+    unrendered_panels : null,  // unrendered panels.
     createBody : function(){
         /** This region's body element 
         * @type Roo.Element */
@@ -32559,6 +32620,15 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
         if(this.config.hidden){
             this.hide();
         }
+        
+        if (this.unrendered_panels && this.unrendered_panels.length) {
+            for (var i =0;i< this.unrendered_panels.length; i++) {
+                this.add(this.unrendered_panels[i]);
+            }
+            this.unrendered_panels = null;
+            
+        }
+        
     },
     
     applyConfig : function(c)
@@ -32671,6 +32741,10 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
 */
     updateBox : function(box)
     {
+        if (!this.bodyEl) {
+            return; // not rendered yet..
+        }
+        
         this.box = box;
         if(!this.collapsed){
             this.el.dom.style.left = box.x + "px";
@@ -32872,7 +32946,8 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
     initPanelAsTab : function(panel){
         var ti = this.tabs.addTab(
                     panel.getEl().id,
-                    panel.getTitle(), null,
+                    panel.getTitle(),
+                    null,
                     this.config.closeOnTab && panel.isClosable()
             );
         if(panel.tabTip !== undefined){
@@ -32979,20 +33054,33 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
      * @param {ContentPanel...} panel The ContentPanel(s) to add (you can pass more than one)
      * @return {Roo.ContentPanel} The panel added (if only one was added; null otherwise)
      */
-    add : function(panel){
+    add : function(panel)
+    {
         if(arguments.length > 1){
             for(var i = 0, len = arguments.length; i < len; i++) {
                 this.add(arguments[i]);
             }
             return null;
         }
+        
+        // if we have not been rendered yet, then we can not really do much of this..
+        if (!this.bodyEl) {
+            this.unrendered_panels.push(panel);
+            return panel;
+        }
+        
+        
+        
+        
         if(this.hasPanel(panel)){
             this.showPanel(panel);
             return panel;
         }
         panel.setRegion(this);
         this.panels.add(panel);
-        if(this.panels.getCount() == 1 && !this.config.alwaysShowTabs){
+       /* if(this.panels.getCount() == 1 && !this.config.alwaysShowTabs){
+            // sinle panel - no tab...?? would it not be better to render it with the tabs,
+            // and hide them... ???
             this.bodyEl.dom.appendChild(panel.getEl().dom);
             if(panel.background !== true){
                 this.setActivePanel(panel);
@@ -33000,6 +33088,7 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
             this.fireEvent("paneladded", this, panel);
             return panel;
         }
+        */
         if(!this.tabs){
             this.initTabs();
         }else{
@@ -34955,8 +35044,12 @@ Roo.extend(Roo.bootstrap.panel.Tabs, Roo.util.Observable, {
     createStripElements :  function(stripEl, text, closable)
     {
         var td = document.createElement("li"); // was td..
-        stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
-        //stripEl.appendChild(td);
+        
+        
+        //stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
+        
+        
+        stripEl.appendChild(td);
         /*if(closable){
             td.className = "x-tabs-closable";
             if(!this.closeTpl){
index bca95a5..bcd3c66 100644 (file)
@@ -108,9 +108,9 @@ for(var i=0;i<D.length;i++){C.push(this.addxtype(Roo.apply({},D[i])));}}this.ite
 };var C=[];if(this.allow_close){C.push({tag:'button',cls:'close',html:'&times'});}C.push(B);var D='';if(this.size.length){D='modal-'+this.size;}var E={cls:"modal",style:'display: none',cn:[{cls:"modal-dialog "+D,cn:[{cls:"modal-content",cn:[{cls:'modal-header',cn:C}
 ,A,{cls:'modal-footer',cn:[{tag:'div',cls:'btn-'+this.buttonPosition}]}]}]}]};if(this.animate){E.cls+=' fade';}return E;},getChildContainer:function(){return this.bodyEl;},getButtonContainer:function(){return this.el.select('.modal-footer div',true).first();
 },initEvents:function(){if(this.allow_close){this.closeEl.on('click',this.hide,this);}Roo.EventManager.onWindowResize(this.resize,this,true);},resize:function(){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));if(this.fitwindow){var w=this.width||Roo.lib.Dom.getViewportWidth(true)-30;
-var h=this.height||Roo.lib.Dom.getViewportHeight(true)-30;this.setSize(w,h)}},setSize:function(w,h){if(!w&&!h){return;}this.resizeTo(w,h);},show:function(){if(!this.rendered){this.render();}this.el.setStyle('display','block');if(this.animate){var A=this;(function(){this.el.addClass('in');
-}).defer(50,this);}else{this.el.addClass('in');}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);
-this.items.forEach(function(e){e.layout?e.layout():false;});this.resize();},hide:function(){this.maskEl.hide();Roo.get(document.body).removeClass("x-body-masked");this.el.removeClass('in');this.el.select('.modal-dialog',true).first().setStyle('transform','');
+var h=this.height||Roo.lib.Dom.getViewportHeight(true)-60;this.setSize(w,h);}},setSize:function(w,h){if(!w&&!h){return;}this.resizeTo(w,h);},show:function(){if(!this.rendered){this.render();}this.el.setStyle('display','block');if(this.animate){var A=this;
+(function(){this.el.addClass('in');}).defer(50,this);}else{this.el.addClass('in');}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);this.resize();(function(){this.items.forEach(function(e){e.layout?e.layout():false;});}).defer(100,this);},hide:function(){this.maskEl.hide();Roo.get(document.body).removeClass("x-body-masked");this.el.removeClass('in');this.el.select('.modal-dialog',true).first().setStyle('transform','');
 if(this.animate){var A=this;(function(){A.el.setStyle('display','none');}).defer(150);}else{this.el.setStyle('display','none');}this.fireEvent('hide',this);},addButton:function(A,cb){var b=Roo.apply({},{html:A});b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button';
 if(typeof(b.listeners)=='undefined'){b.listeners={click:cb.createDelegate(this)};}var B=Roo.factory(b);B.render(this.el.select('.modal-footer div').first());return B;},setDefaultButton:function(A){},diff:false,resizeTo:function(w,h){this.dialogEl.setWidth(w);
 if(this.diff===false){this.diff=this.dialogEl.getHeight()-this.bodyEl.getHeight();}this.bodyEl.setHeight(h-this.diff);},setContentSize:function(w,h){},onButtonClick:function(A,e){this.fireEvent('btnclick',A.name,e);},setTitle:function(A){this.titleEl.dom.innerHTML=A;
@@ -334,19 +334,19 @@ B.tag='li';}return B;},inputEl:function(){return this.el.select('input.form-cont
 },setDisabled:function(v){var i=this.inputEl().dom;if(!v){i.removeAttribute('disabled');return;}i.setAttribute('disabled','true');},initEvents:function(){this.inputEl().on("keydown",this.fireKey,this);this.inputEl().on("focus",this.onFocus,this);this.inputEl().on("blur",this.onBlur,this);
 this.inputEl().relayEvent('keyup',this);this.indicator=this.indicatorEl();if(this.indicator){this.indicator.setVisibilityMode(Roo.Element.DISPLAY);this.indicator.hide();}this.originalValue=this.getValue();if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);
 this.inputEl().on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.inputEl().on(this.validationEvent,this.validate,this,{buffer:this.validationDelay});}if(this.selectOnFocus){this.on("focus",this.preFocus,this);}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.inputEl().on("keypress",this.filterKeys,this);
-}if(this.inputEl().is('input[type=password]')&&Roo.isSafari){this.inputEl().on('keydown',this.SafariOnKeyDown,this);}if(typeof(this.before)=='object'){this.before.render(this.el.select('.roo-input-before',true).first());}if(typeof(this.after)=='object'){this.after.render(this.el.select('.roo-input-after',true).first());
-}},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},validate:function(){if(this.disabled||this.validateValue(this.getRawValue())){this.markValid();return true;}this.markInvalid();return false;},validateValue:function(A){if(A.length<1){if(this.allowBlank){return true;
-}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);if(B!==true){return false;
-}}if(this.regex&&!this.regex.test(A)){return false;}return true;},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},focus:function(A){if(this.rendered){this.inputEl().focus();if(A===true){this.inputEl().dom.select();}}return this;
-},onFocus:function(){if(!Roo.isOpera&&this.focusClass){}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){}this.hasFocus=false;
-if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);},reset:function(){this.setValue(this.originalValue);
-this.validate();},getName:function(){return this.name;},getValue:function(){var v=this.inputEl().getValue();return v;},getRawValue:function(){var v=this.inputEl().getValue();return v;},setRawValue:function(v){return this.inputEl().dom.value=(v===null||v===undefined?'':v);
-},selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.inputEl().dom;if(d.setSelectionRange){d.setSelectionRange(A,B);}else if(d.createTextRange){var C=d.createTextRange();C.moveStart("character",A);
-C.moveEnd("character",v.length-B);C.select();}}},setValue:function(v){this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);this.validate();}},preFocus:function(){if(this.selectOnFocus){this.inputEl().dom.select();}},filterKeys:function(e){var k=e.getKey();
-if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();}},clearInvalid:function(){if(!this.el||this.preventMark){return;
-}if(this.indicator){this.indicator.hide();}this.el.removeClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);
-}}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);
-}if(this.disabled||this.allowBlank){return;}if(this.indicator){this.indicator.hide();}this.el.addClass(this.validClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();
+}else{this.inputEl().relayEvent('keypress',this);}if(this.inputEl().is('input[type=password]')&&Roo.isSafari){this.inputEl().on('keydown',this.SafariOnKeyDown,this);}if(typeof(this.before)=='object'){this.before.render(this.el.select('.roo-input-before',true).first());
+}if(typeof(this.after)=='object'){this.after.render(this.el.select('.roo-input-after',true).first());}},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},validate:function(){if(this.disabled||this.validateValue(this.getRawValue())){this.markValid();
+return true;}this.markInvalid();return false;},validateValue:function(A){if(A.length<1){if(this.allowBlank){return true;}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;
+if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);if(B!==true){return false;}}if(this.regex&&!this.regex.test(A)){return false;}return true;},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);
+}},focus:function(A){if(this.rendered){this.inputEl().focus();if(A===true){this.inputEl().dom.select();}}return this;},onFocus:function(){if(!Roo.isOpera&&this.focusClass){}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);
+}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);
+}this.fireEvent("blur",this);},reset:function(){this.setValue(this.originalValue);this.validate();},getName:function(){return this.name;},getValue:function(){var v=this.inputEl().getValue();return v;},getRawValue:function(){var v=this.inputEl().getValue();
+return v;},setRawValue:function(v){return this.inputEl().dom.value=(v===null||v===undefined?'':v);},selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.inputEl().dom;if(d.setSelectionRange){d.setSelectionRange(A,B);
+}else if(d.createTextRange){var C=d.createTextRange();C.moveStart("character",A);C.moveEnd("character",v.length-B);C.select();}}},setValue:function(v){this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);this.validate();}
+},preFocus:function(){if(this.selectOnFocus){this.inputEl().dom.select();}},filterKeys:function(e){var k=e.getKey();if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;
+}if(!this.maskRe.test(cc)){e.stopEvent();}},clearInvalid:function(){if(!this.el||this.preventMark){return;}if(this.indicator){this.indicator.hide();}this.el.removeClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var A=this.el.select('.form-control-feedback',true).first();
+if(A){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);}}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);var A=this.el.select('.form-control-feedback',true).first();
+if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;}if(this.indicator){this.indicator.hide();}this.el.addClass(this.validClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();
 if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return;
 }this.el.removeClass([this.invalidClass,this.validClass]);var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;
 }if(this.indicator){this.indicator.show();}this.el.addClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);
@@ -697,7 +697,7 @@ Roo.bootstrap.DateField=function(A){Roo.bootstrap.DateField.superclass.construct
 },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;
+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.pickerEl=Roo.get(document.body).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;if(this.singleMode){Roo.each(this.picker().select('thead > tr > th',true).elements,function(v){v.setVisibilityMode(Roo.Element.DISPLAY);
@@ -740,8 +740,11 @@ if(this.startDate!==-Infinity){this.startDate=this.parseDate(this.startDate);}th
 }break;case 1:case 2:if(this.startDate!==-Infinity&&A<=this.startDate.getUTCFullYear()){v.hide();}break;}});Roo.each(this.picker().select('.next',true).elements,function(v){v.show();switch(this.viewMode){case 0:if(this.endDate!==Infinity&&A>=this.endDate.getUTCFullYear()&&B>=this.endDate.getUTCMonth()){v.hide();
 }break;case 1:case 2:if(this.endDate!==Infinity&&A>=this.endDate.getUTCFullYear()){v.hide();}break;}})},moveMonth:function(A,B){if(!B){return A;}var C=new Date(A.valueOf()),D=C.getUTCDate(),E=C.getUTCMonth(),F=Math.abs(B),G,H;B=B>0?1:-1;if(F==1){H=B==-1?function(){return C.getUTCMonth()==E;
 }:function(){return C.getUTCMonth()!=G;};G=E+B;C.setUTCMonth(G);if(G<0||G>11){G=(G+12)%12;}}else{for(var i=0;i<F;i++){C=this.moveMonth(C,B);}G=C.getUTCMonth();C.setUTCDate(D);H=function(){return G!=C.getUTCMonth();};}while(H()){C.setUTCDate(--D);C.setUTCMonth(G);
-}return C;},moveYear:function(A,B){return this.moveMonth(A,B*12);},dateWithinRange:function(A){return A>=this.startDate&&A<=this.endDate;},remove:function(){this.picker().remove();}});Roo.apply(Roo.bootstrap.DateField,{head:{tag:'thead',cn:[{tag:'tr',cn:[{tag:'th',cls:'prev',html:'<i class="fa fa-arrow-left"/>'}
-,{tag:'th',cls:'switch',colspan:'5'},{tag:'th',cls:'next',html:'<i class="fa fa-arrow-right"/>'}]}]},content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},footer:{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'today'}]}]},dates:{en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}
+}return C;},moveYear:function(A,B){return this.moveMonth(A,B*12);},dateWithinRange:function(A){return A>=this.startDate&&A<=this.endDate;},remove:function(){this.picker().remove();},validateValue:function(A){if(A.length<1){if(this.allowBlank){return true;
+}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);if(B!==true){return false;
+}}if(this.regex&&!this.regex.test(A)){return false;}if(typeof(this.parseDate(A))=='undefined'){return false;}if(this.endDate!==Infinity&&this.parseDate(A).getTime()>this.endDate.getTime()){return false;}if(this.startDate!==-Infinity&&this.parseDate(A).getTime()<this.startDate.getTime()){return false;
+}return true;}});Roo.apply(Roo.bootstrap.DateField,{head:{tag:'thead',cn:[{tag:'tr',cn:[{tag:'th',cls:'prev',html:'<i class="fa fa-arrow-left"/>'},{tag:'th',cls:'switch',colspan:'5'},{tag:'th',cls:'next',html:'<i class="fa fa-arrow-right"/>'}]}]},content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}
+]}]},footer:{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'today'}]}]},dates:{en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}
 },modes:[{clsName:'days',navFnc:'Month',navStep:1},{clsName:'months',navFnc:'FullYear',navStep:1},{clsName:'years',navFnc:'FullYear',navStep:10}]});Roo.apply(Roo.bootstrap.DateField,{template:{tag:'div',cls:'datepicker dropdown-menu roo-dynamic',cn:[{tag:'div',cls:'datepicker-days',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,{tag:'tbody'}
 ,Roo.bootstrap.DateField.footer]}]},{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,Roo.bootstrap.DateField.content,Roo.bootstrap.DateField.footer]}]},{tag:'div',cls:'datepicker-years',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,Roo.bootstrap.DateField.content,Roo.bootstrap.DateField.footer]}
 ]}]}});
@@ -1329,12 +1332,12 @@ this.layout();},onRegionCollapsed:function(A){this.fireEvent("regioncollapsed",A
 Roo.bootstrap.layout.Border=function(A){A=A||{};Roo.bootstrap.layout.Border.superclass.constructor.call(this,A);Roo.each(Roo.bootstrap.layout.Border.regions,function(B){if(A[B]){A[B].region=B;this.addRegion(A[B]);}},this);};Roo.bootstrap.layout.Border.regions=["north","south","east","west","center"];
 Roo.extend(Roo.bootstrap.layout.Border,Roo.bootstrap.layout.Manager,{addRegion:function(A){if(!this.regions[A.region]){var r=this.factory(A);this.bindRegion(r);}return this.regions[A.region];},bindRegion:function(r){this.regions[r.config.region]=r;r.on("visibilitychange",this.layout,this);
 r.on("paneladded",this.layout,this);r.on("panelremoved",this.layout,this);r.on("invalidated",this.layout,this);r.on("resized",this.onRegionResized,this);r.on("collapsed",this.onRegionCollapsed,this);r.on("expanded",this.onRegionExpanded,this);},layout:function(){if(this.updating){return;
-}var A=this.getViewSize();var w=A.width;var h=A.height;var B=w;var C=h;var D=0;var E=0;var rs=this.regions;var F=rs["north"];var G=rs["south"];var H=rs["west"];var I=rs["east"];var J=rs["center"];if(F&&F.isVisible()){var b=F.getBox();var m=F.getMargins();
-b.width=w-(m.left+m.right);b.x=m.left;b.y=m.top;D=b.height+b.y+m.bottom;C-=D;F.updateBox(this.safeBox(b));}if(G&&G.isVisible()){var b=G.getBox();var m=G.getMargins();b.width=w-(m.left+m.right);b.x=m.left;var K=(b.height+m.top+m.bottom);b.y=h-K+m.top;C-=K;
-G.updateBox(this.safeBox(b));}if(H&&H.isVisible()){var b=H.getBox();var m=H.getMargins();b.height=C-(m.top+m.bottom);b.x=m.left;b.y=D+m.top;var L=(b.width+m.left+m.right);E+=L;B-=L;H.updateBox(this.safeBox(b));}if(I&&I.isVisible()){var b=I.getBox();var m=I.getMargins();
-b.height=C-(m.top+m.bottom);var L=(b.width+m.left+m.right);b.x=w-L+m.left;b.y=D+m.top;B-=L;I.updateBox(this.safeBox(b));}if(J){var m=J.getMargins();var M={x:E+m.left,y:D+m.top,width:B-(m.left+m.right),height:C-(m.top+m.bottom)};J.updateBox(this.safeBox(M));
-}this.el.repaint();this.fireEvent("layout",this);},safeBox:function(A){A.width=Math.max(0,A.width);A.height=Math.max(0,A.height);return A;},add:function(A,B){A=A.toLowerCase();return this.regions[A].add(B);},remove:function(A,B){A=A.toLowerCase();return this.regions[A].remove(B);
-},findPanel:function(A){var rs=this.regions;for(var B in rs){if(typeof rs[B]!="function"){var p=rs[B].getPanel(A);if(p){return p;}}}return null;},showPanel:function(A){var rs=this.regions;for(var B in rs){var r=rs[B];if(typeof r!="function"){if(r.hasPanel(A)){return r.showPanel(A);
+}Roo.each(Roo.bootstrap.layout.Border.regions,function(N){if(this.regions[N]&&!this.regions[N].bodyEl){this.regions[N].onRender(this.el)}},this);var A=this.getViewSize();var w=A.width;var h=A.height;var B=w;var C=h;var D=0;var E=0;var rs=this.regions;var F=rs["north"];
+var G=rs["south"];var H=rs["west"];var I=rs["east"];var J=rs["center"];if(F&&F.isVisible()){var b=F.getBox();var m=F.getMargins();b.width=w-(m.left+m.right);b.x=m.left;b.y=m.top;D=b.height+b.y+m.bottom;C-=D;F.updateBox(this.safeBox(b));}if(G&&G.isVisible()){var b=G.getBox();
+var m=G.getMargins();b.width=w-(m.left+m.right);b.x=m.left;var K=(b.height+m.top+m.bottom);b.y=h-K+m.top;C-=K;G.updateBox(this.safeBox(b));}if(H&&H.isVisible()){var b=H.getBox();var m=H.getMargins();b.height=C-(m.top+m.bottom);b.x=m.left;b.y=D+m.top;var L=(b.width+m.left+m.right);
+E+=L;B-=L;H.updateBox(this.safeBox(b));}if(I&&I.isVisible()){var b=I.getBox();var m=I.getMargins();b.height=C-(m.top+m.bottom);var L=(b.width+m.left+m.right);b.x=w-L+m.left;b.y=D+m.top;B-=L;I.updateBox(this.safeBox(b));}if(J){var m=J.getMargins();var M={x:E+m.left,y:D+m.top,width:B-(m.left+m.right),height:C-(m.top+m.bottom)}
+;J.updateBox(this.safeBox(M));}this.el.repaint();this.fireEvent("layout",this);},safeBox:function(A){A.width=Math.max(0,A.width);A.height=Math.max(0,A.height);return A;},add:function(A,B){A=A.toLowerCase();return this.regions[A].add(B);},remove:function(A,B){A=A.toLowerCase();
+return this.regions[A].remove(B);},findPanel:function(A){var rs=this.regions;for(var B in rs){if(typeof rs[B]!="function"){var p=rs[B].getPanel(A);if(p){return p;}}}return null;},showPanel:function(A){var rs=this.regions;for(var B in rs){var r=rs[B];if(typeof r!="function"){if(r.hasPanel(A)){return r.showPanel(A);
 }}}return null;},addxtype:function(A){var B=false;if(typeof(A.region)=='undefined'){Roo.log("Failed to add Panel, region was not set");Roo.log(A);return false;}var C=A.region;delete A.region;var D=[];if(A.items){D=A.items;delete A.items;}var nb=false;switch(A.xtype){case 'Content':case 'Scroll':case 'View':A.autoCreate=true;
 B=new A.xns[A.xtype](A);this.add(C,B);break;case 'Nest':var E=A.layout;E.el=this.el.createChild();E.items=E.items||[];delete A.layout;D=E.items;if(C=='center'&&this.active&&this.getRegion('center').panels.length<1){A.background=false;}A.layout=new Roo.bootstrap.layout.Border(E);
 B=new A.xns[A.xtype](A);this.add(C,B);nb={};break;case 'Grid':if(C=='center'&&this.active){A.background=false;}B=new A.xns[A.xtype](A);this.add(C,B);break;case 'Border':B=this;break;default:Roo.log(A);throw "Can not add '"+A.xtype+"' to Border";return null;
@@ -1354,28 +1357,29 @@ if(!A.background){this.setActivePanel(A);if(this.config.initialSize&&this.panels
 },remove:function(A,B){A=this.getPanel(A);if(!A){return null;}var e={};this.fireEvent("beforeremove",this,A,e);if(e.cancel===true){return null;}var C=A.getId();this.panels.removeKey(C);return A;},getPanel:function(id){if(typeof id=="object"){return id;}return this.panels.get(id);
 },getPosition:function(){return this.position;}});
 // Roo/bootstrap/layout/Region.js
-Roo.bootstrap.layout.Region=function(A){this.applyConfig(A);var B=A.mgr;var C=A.region;A.skipConfig=true;Roo.bootstrap.layout.Region.superclass.constructor.call(this,A);if(B.el){this.onRender(B.el);}this.visible=true;this.collapsed=false;};Roo.extend(Roo.bootstrap.layout.Region,Roo.bootstrap.layout.Basic,{position:'',createBody:function(){this.bodyEl=this.el.createChild({tag:"div",cls:"roo-layout-panel-body tab-content"}
-);},onRender:function(A,B){var dh=Roo.DomHelper;this.el=dh.append(A.dom,{tag:"div",cls:(this.config.cls||'')+" roo-layout-region roo-layout-panel roo-layout-panel-"+this.position},true);this.titleEl=dh.append(this.el.dom,{tag:"div",unselectable:"on",cls:"roo-unselectable roo-layout-panel-hd breadcrumb roo-layout-title-"+this.position,children:[{tag:"span",cls:"roo-unselectable roo-layout-panel-hd-text",unselectable:"on",html:"&#160;"}
+Roo.bootstrap.layout.Region=function(A){this.applyConfig(A);var B=A.mgr;var C=A.region;A.skipConfig=true;Roo.bootstrap.layout.Region.superclass.constructor.call(this,A);if(B.el){this.onRender(B.el);}this.visible=true;this.collapsed=false;this.unrendered_panels=[];
+};Roo.extend(Roo.bootstrap.layout.Region,Roo.bootstrap.layout.Basic,{position:'',unrendered_panels:null,createBody:function(){this.bodyEl=this.el.createChild({tag:"div",cls:"roo-layout-panel-body tab-content"});},onRender:function(A,B){var dh=Roo.DomHelper;
+this.el=dh.append(A.dom,{tag:"div",cls:(this.config.cls||'')+" roo-layout-region roo-layout-panel roo-layout-panel-"+this.position},true);this.titleEl=dh.append(this.el.dom,{tag:"div",unselectable:"on",cls:"roo-unselectable roo-layout-panel-hd breadcrumb roo-layout-title-"+this.position,children:[{tag:"span",cls:"roo-unselectable roo-layout-panel-hd-text",unselectable:"on",html:"&#160;"}
 ,{tag:"div",cls:"roo-unselectable roo-layout-panel-hd-tools",unselectable:"on"}]},true);this.titleEl.enableDisplayMode();this.titleTextEl=this.titleEl.dom.firstChild;this.tools=Roo.get(this.titleEl.dom.childNodes[1],true);this.createBody(this.config);if(this.config.hideWhenEmpty){this.hide();
 this.on("paneladded",this.validateVisibility,this);this.on("panelremoved",this.validateVisibility,this);}if(this.autoScroll){this.bodyEl.setStyle("overflow","auto");}else{this.bodyEl.setStyle("overflow",this.config.overflow||'hidden');}if((!this.config.titlebar&&!this.config.title)||this.config.titlebar===false){this.titleEl.hide();
-}else{this.titleEl.show();if(this.config.title){this.titleTextEl.innerHTML=this.config.title;}}if(this.config.collapsed){this.collapse(true);}if(this.config.hidden){this.hide();}},applyConfig:function(c){this.margins=c.margins||this.margins||{top:0,left:0,right:0,bottom:0}
-;this.bottomTabs=c.tabPosition!="top";this.autoScroll=c.autoScroll||false;this.duration=c.duration||.30;this.slideDuration=c.slideDuration||.45;this.config=c;},isVisible:function(){return this.visible;},getBox:function(){var b;b=this.el.getBox(false,true);
-return b;},getMargins:function(){return this.margins;},updateBox:function(A){this.box=A;if(!this.collapsed){this.el.dom.style.left=A.x+"px";this.el.dom.style.top=A.y+"px";this.updateBody(A.width,A.height);}else{this.collapsedEl.dom.style.left=A.x+"px";this.collapsedEl.dom.style.top=A.y+"px";
-this.collapsedEl.setSize(A.width,A.height);}if(this.tabs){this.tabs.autoSizeTabs();}},updateBody:function(w,h){if(w!==null){this.el.setWidth(w);w-=this.el.getBorderWidth("rl");if(this.config.adjustments){w+=this.config.adjustments[0];}}if(h!==null){this.el.setHeight(h);
-h=this.titleEl&&this.titleEl.isDisplayed()?h-(this.titleEl.getHeight()||0):h;h-=this.el.getBorderWidth("tb");if(this.config.adjustments){h+=this.config.adjustments[1];}this.bodyEl.setHeight(h);if(this.tabs){h=this.tabs.syncHeight(h);}}if(this.panelSize){w=w!==null?w:this.panelSize.width;
-h=h!==null?h:this.panelSize.height;}if(this.activePanel){var el=this.activePanel.getEl();w=w!==null?w:el.getWidth();h=h!==null?h:el.getHeight();this.panelSize={width:w,height:h};this.activePanel.setSize(w,h);}if(Roo.isIE&&this.tabs){this.tabs.el.repaint();
-}},getEl:function(){return this.el;},hide:function(){this.el.dom.style.left="-2000px";this.el.hide();this.visible=false;this.fireEvent("visibilitychange",this,false);},show:function(){this.el.show();this.visible=true;this.fireEvent("visibilitychange",this,true);
-},animateCollapse:function(){},animateExpand:function(){},initTabs:function(){this.bodyEl.setStyle("overflow","hidden");var ts=new Roo.bootstrap.panel.Tabs({el:this.bodyEl.dom,tabPosition:this.bottomTabs?'bottom':'top',disableTooltips:this.config.disableTabTips,toolbar:this.config.toolbar}
-);if(this.config.hideTabs){ts.stripWrap.setDisplayed(false);}this.tabs=ts;ts.resizeTabs=this.config.resizeTabs===true;ts.minTabWidth=this.config.minTabWidth||40;ts.maxTabWidth=this.config.maxTabWidth||250;ts.preferredTabWidth=this.config.preferredTabWidth||150;
-ts.monitorResize=false;ts.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");ts.bodyEl.addClass('roo-layout-tabs-body');this.panels.each(this.initPanelAsTab,this);},initPanelAsTab:function(A){var ti=this.tabs.addTab(A.getEl().id,A.getTitle(),null,this.config.closeOnTab&&A.isClosable());
-if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);}ti.on("activate",function(){this.setActivePanel(A);},this);if(this.config.closeOnTab){ti.on("beforeclose",function(t,e){e.cancel=true;this.remove(A);},this);}return ti;},updatePanelTitle:function(A,B){if(this.activePanel==A){this.updateTitle(B);
-}if(this.tabs){var ti=this.tabs.getTab(A.getEl().id);ti.setText(B);if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);}}},updateTitle:function(A){if(this.titleTextEl&&!this.config.title){this.titleTextEl.innerHTML=(typeof A!="undefined"&&A.length>0?A:"&#160;");
-}},setActivePanel:function(A){A=this.getPanel(A);if(this.activePanel&&this.activePanel!=A){this.activePanel.setActiveState(false);}this.activePanel=A;A.setActiveState(true);if(this.panelSize){A.setSize(this.panelSize.width,this.panelSize.height);}if(this.closeBtn){this.closeBtn.setVisible(!this.config.closeOnTab&&!this.isSlid&&A.isClosable());
-}this.updateTitle(A.getTitle());if(this.tabs){this.fireEvent("invalidated",this);}this.fireEvent("panelactivated",this,A);},showPanel:function(A){A=this.getPanel(A);if(A){if(this.tabs){var B=this.tabs.getTab(A.getEl().id);if(B.isHidden()){this.tabs.unhideTab(B.id);
-}B.activate();}else{this.setActivePanel(A);}}return A;},getActivePanel:function(){return this.activePanel;},validateVisibility:function(){if(this.panels.getCount()<1){this.updateTitle("&#160;");this.closeBtn.hide();this.hide();}else{if(!this.isVisible()){this.show();
-}}},add:function(A){if(arguments.length>1){for(var i=0,B=arguments.length;i<B;i++){this.add(arguments[i]);}return null;}if(this.hasPanel(A)){this.showPanel(A);return A;}A.setRegion(this);this.panels.add(A);if(this.panels.getCount()==1&&!this.config.alwaysShowTabs){this.bodyEl.dom.appendChild(A.getEl().dom);
-if(A.background!==true){this.setActivePanel(A);}this.fireEvent("paneladded",this,A);return A;}if(!this.tabs){this.initTabs();}else{this.initPanelAsTab(A);}if(A.background!==true){this.tabs.activate(A.getEl().id);}this.fireEvent("paneladded",this,A);return A;
-},hidePanel:function(A){if(this.tabs&&(A=this.getPanel(A))){this.tabs.hideTab(A.getEl().id);}},unhidePanel:function(A){if(this.tabs&&(A=this.getPanel(A))){this.tabs.unhideTab(A.getEl().id);}},clearPanels:function(){while(this.panels.getCount()>0){this.remove(this.panels.first());
+}else{this.titleEl.show();if(this.config.title){this.titleTextEl.innerHTML=this.config.title;}}if(this.config.collapsed){this.collapse(true);}if(this.config.hidden){this.hide();}if(this.unrendered_panels&&this.unrendered_panels.length){for(var i=0;i<this.unrendered_panels.length;
+i++){this.add(this.unrendered_panels[i]);}this.unrendered_panels=null;}},applyConfig:function(c){this.margins=c.margins||this.margins||{top:0,left:0,right:0,bottom:0};this.bottomTabs=c.tabPosition!="top";this.autoScroll=c.autoScroll||false;this.duration=c.duration||.30;
+this.slideDuration=c.slideDuration||.45;this.config=c;},isVisible:function(){return this.visible;},getBox:function(){var b;b=this.el.getBox(false,true);return b;},getMargins:function(){return this.margins;},updateBox:function(A){if(!this.bodyEl){return;}this.box=A;
+if(!this.collapsed){this.el.dom.style.left=A.x+"px";this.el.dom.style.top=A.y+"px";this.updateBody(A.width,A.height);}else{this.collapsedEl.dom.style.left=A.x+"px";this.collapsedEl.dom.style.top=A.y+"px";this.collapsedEl.setSize(A.width,A.height);}if(this.tabs){this.tabs.autoSizeTabs();
+}},updateBody:function(w,h){if(w!==null){this.el.setWidth(w);w-=this.el.getBorderWidth("rl");if(this.config.adjustments){w+=this.config.adjustments[0];}}if(h!==null){this.el.setHeight(h);h=this.titleEl&&this.titleEl.isDisplayed()?h-(this.titleEl.getHeight()||0):h;
+h-=this.el.getBorderWidth("tb");if(this.config.adjustments){h+=this.config.adjustments[1];}this.bodyEl.setHeight(h);if(this.tabs){h=this.tabs.syncHeight(h);}}if(this.panelSize){w=w!==null?w:this.panelSize.width;h=h!==null?h:this.panelSize.height;}if(this.activePanel){var el=this.activePanel.getEl();
+w=w!==null?w:el.getWidth();h=h!==null?h:el.getHeight();this.panelSize={width:w,height:h};this.activePanel.setSize(w,h);}if(Roo.isIE&&this.tabs){this.tabs.el.repaint();}},getEl:function(){return this.el;},hide:function(){this.el.dom.style.left="-2000px";this.el.hide();
+this.visible=false;this.fireEvent("visibilitychange",this,false);},show:function(){this.el.show();this.visible=true;this.fireEvent("visibilitychange",this,true);},animateCollapse:function(){},animateExpand:function(){},initTabs:function(){this.bodyEl.setStyle("overflow","hidden");
+var ts=new Roo.bootstrap.panel.Tabs({el:this.bodyEl.dom,tabPosition:this.bottomTabs?'bottom':'top',disableTooltips:this.config.disableTabTips,toolbar:this.config.toolbar});if(this.config.hideTabs){ts.stripWrap.setDisplayed(false);}this.tabs=ts;ts.resizeTabs=this.config.resizeTabs===true;
+ts.minTabWidth=this.config.minTabWidth||40;ts.maxTabWidth=this.config.maxTabWidth||250;ts.preferredTabWidth=this.config.preferredTabWidth||150;ts.monitorResize=false;ts.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");ts.bodyEl.addClass('roo-layout-tabs-body');
+this.panels.each(this.initPanelAsTab,this);},initPanelAsTab:function(A){var ti=this.tabs.addTab(A.getEl().id,A.getTitle(),null,this.config.closeOnTab&&A.isClosable());if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);}ti.on("activate",function(){this.setActivePanel(A);
+},this);if(this.config.closeOnTab){ti.on("beforeclose",function(t,e){e.cancel=true;this.remove(A);},this);}return ti;},updatePanelTitle:function(A,B){if(this.activePanel==A){this.updateTitle(B);}if(this.tabs){var ti=this.tabs.getTab(A.getEl().id);ti.setText(B);
+if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);}}},updateTitle:function(A){if(this.titleTextEl&&!this.config.title){this.titleTextEl.innerHTML=(typeof A!="undefined"&&A.length>0?A:"&#160;");}},setActivePanel:function(A){A=this.getPanel(A);if(this.activePanel&&this.activePanel!=A){this.activePanel.setActiveState(false);
+}this.activePanel=A;A.setActiveState(true);if(this.panelSize){A.setSize(this.panelSize.width,this.panelSize.height);}if(this.closeBtn){this.closeBtn.setVisible(!this.config.closeOnTab&&!this.isSlid&&A.isClosable());}this.updateTitle(A.getTitle());if(this.tabs){this.fireEvent("invalidated",this);
+}this.fireEvent("panelactivated",this,A);},showPanel:function(A){A=this.getPanel(A);if(A){if(this.tabs){var B=this.tabs.getTab(A.getEl().id);if(B.isHidden()){this.tabs.unhideTab(B.id);}B.activate();}else{this.setActivePanel(A);}}return A;},getActivePanel:function(){return this.activePanel;
+},validateVisibility:function(){if(this.panels.getCount()<1){this.updateTitle("&#160;");this.closeBtn.hide();this.hide();}else{if(!this.isVisible()){this.show();}}},add:function(A){if(arguments.length>1){for(var i=0,B=arguments.length;i<B;i++){this.add(arguments[i]);
+}return null;}if(!this.bodyEl){this.unrendered_panels.push(A);return A;}if(this.hasPanel(A)){this.showPanel(A);return A;}A.setRegion(this);this.panels.add(A);if(!this.tabs){this.initTabs();}else{this.initPanelAsTab(A);}if(A.background!==true){this.tabs.activate(A.getEl().id);
+}this.fireEvent("paneladded",this,A);return A;},hidePanel:function(A){if(this.tabs&&(A=this.getPanel(A))){this.tabs.hideTab(A.getEl().id);}},unhidePanel:function(A){if(this.tabs&&(A=this.getPanel(A))){this.tabs.unhideTab(A.getEl().id);}},clearPanels:function(){while(this.panels.getCount()>0){this.remove(this.panels.first());
 }},remove:function(A,B){A=this.getPanel(A);if(!A){return null;}var e={};this.fireEvent("beforeremove",this,A,e);if(e.cancel===true){return null;}B=(typeof B!="undefined"?B:(this.config.preservePanels===true||A.preserve===true));var C=A.getId();this.panels.removeKey(C);
 if(B){document.body.appendChild(A.getEl().dom);}if(this.tabs){this.tabs.removeTab(A.getEl().id);}else if(!B){this.bodyEl.dom.removeChild(A.getEl().dom);}if(this.panels.getCount()==1&&this.tabs&&!this.config.alwaysShowTabs){var p=this.panels.first();var D=document.createElement("div");
 D.appendChild(p.getEl().dom);this.bodyEl.update("");this.bodyEl.dom.appendChild(p.getEl().dom);D=null;this.updateTitle(p.getTitle());this.tabs=null;this.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");this.setActivePanel(p);}A.setRegion(null);
@@ -1466,8 +1470,8 @@ this.setTabWidth(Math.max(C,this.minTabWidth)-2);if(C<this.minTabWidth){}}else{i
 for(var i=0,B=this.items.length;i<B;i++){if(!this.items[i].isHidden()){this.items[i].setWidth(A);}}},destroy:function(A){Roo.EventManager.removeResizeListener(this.onResize,this);for(var i=0,B=this.items.length;i<B;i++){this.items[i].purgeListeners();}if(A===true){this.el.update("");
 this.el.remove();}},createStrip:function(A){var B=document.createElement("nav");B.className="navbar navbar-default";A.appendChild(B);return B;},createStripList:function(A){A.innerHTML='<ul class="nav nav-tabs" role="tablist"></ul>';return A.firstChild;},createBody:function(A){var B=document.createElement("div");
 Roo.id(B,"tab-body");Roo.fly(B).addClass("tab-content");A.appendChild(B);return B;},createItemBody:function(A,id){var B=Roo.getDom(id);if(!B){B=document.createElement("div");B.id=id;}Roo.fly(B).addClass("tab-pane");A.insertBefore(B,A.firstChild);return B;
-},createStripElements:function(A,B,C){var td=document.createElement("li");A.insertBefore(td,A.childNodes[A.childNodes.length-1]);if(!this.tabTpl){this.tabTpl=new Roo.Template('<a href="#">'+'<span unselectable="on"'+(this.disableTooltips?'':' title="{text}"')+' >{text}</span></span></a>');
-}var el=this.tabTpl.overwrite(td,{"text":B});var D=el.getElementsByTagName("span")[0];return {"el":el,"inner":D};}});
+},createStripElements:function(A,B,C){var td=document.createElement("li");A.appendChild(td);if(!this.tabTpl){this.tabTpl=new Roo.Template('<a href="#">'+'<span unselectable="on"'+(this.disableTooltips?'':' title="{text}"')+' >{text}</span></span></a>');}var el=this.tabTpl.overwrite(td,{"text":B}
+);var D=el.getElementsByTagName("span")[0];return {"el":el,"inner":D};}});
 // Roo/bootstrap/panel/TabItem.js
 Roo.bootstrap.panel.TabItem=function(A){this.tabPanel=A.panel;this.id=A.id;this.disabled=false;this.text=A.text;this.loaded=false;this.closable=A.closable;this.bodyEl=Roo.get(this.tabPanel.createItemBody(this.tabPanel.bodyEl.dom,A.id));this.bodyEl.setVisibilityMode(Roo.Element.VISIBILITY);
 this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");var B=this.tabPanel.createStripElements(this.tabPanel.stripEl.dom,A.text,A.closable);this.el=Roo.get(B.el);this.inner=Roo.get(B.inner,true);this.textEl=Roo.get(this.el.dom.firstChild,true);