From: Alan Knowles Date: Thu, 29 Nov 2018 02:44:41 +0000 (+0800) Subject: Uncommited changes synced X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=1b413ddf4b556515c4be626a9776713a8143e966 Uncommited changes synced --- diff --git a/Roo/bootstrap/Button.js b/Roo/bootstrap/Button.js index 6c0fa0d291..fee7e93885 100644 --- a/Roo/bootstrap/Button.js +++ b/Roo/bootstrap/Button.js @@ -11,6 +11,7 @@ * Bootstrap Button class * @cfg {String} html The button content * @cfg {String} weight (default | primary | secondary | success | info | warning | danger | link ) default + * @cfg {String} badge_weight (default | primary | secondary | success | info | warning | danger | link ) default (same as button) * @cfg {Boolean} outline default false (except for weight=default which emulates old behaveiour with an outline) * @cfg {String} size ( lg | sm | xs) * @cfg {String} tag ( a | input | submit) @@ -69,6 +70,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { html: false, active: false, weight: '', + badge_weight: '', outline : false, size: '', tag: 'button', @@ -244,12 +246,15 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { }; } + var bw = this.badge_weight.length ? this.badge_weight : + (this.weight.length ? this.weight : 'secondary'); + bw = bw == 'default' ? 'secondary' : bw; cfg.cn = [ value, { tag: 'span', - cls: 'badge', + cls: 'badge badge-' + bw, html: this.badge } ]; @@ -382,13 +387,13 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { setWeight : function(str) { - this.weight = str; + this.el.removeClass(this.weightClass); + this.weight = str; var outline = this.outline ? 'outline-' : ''; if (str == 'default') { - outline = 'outline-'; - str = 'secondary'; + this.el.addClass('btn-default btn-outline-secondary'); + return; } - this.el.removeClass(this.weightClass); this.el.addClass('btn-' + outline + str); } diff --git a/Roo/bootstrap/Form.js b/Roo/bootstrap/Form.js index fd22653ef4..74aa41bae7 100644 --- a/Roo/bootstrap/Form.js +++ b/Roo/bootstrap/Form.js @@ -125,7 +125,7 @@ Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, { cls : '' }; if (this.parent().xtype.match(/^Nav/)) { - cfg.cls = 'navbar-form navbar-' + this.align; + cfg.cls = 'navbar-form form-inline navbar-' + this.align; } diff --git a/Roo/bootstrap/NavSimplebar.js b/Roo/bootstrap/NavSimplebar.js index dfc468a703..3459857cdc 100644 --- a/Roo/bootstrap/NavSimplebar.js +++ b/Roo/bootstrap/NavSimplebar.js @@ -21,7 +21,7 @@ * * @cfg {String} tag (header|footer|nav|div) default is nav - * + * @cfg {String} weight (light|primary|secondary|success|danger|warning|info|dark|white) default is light. * * * @constructor @@ -42,7 +42,7 @@ Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar, { arrangement: '', align : false, - + weight : 'light', main : false, @@ -55,8 +55,13 @@ Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar, { var cfg = { tag : this.tag || 'div', - cls : 'navbar' + cls : 'navbar navbar-expand-lg' }; + if (['light','white'].indexOf(this.weight) > -1) { + cfg.cls += ['light','white'].indexOf(this.weight) > -1 ? ' navbar-light' : ' navbar-dark'; + } + cfg.cls += ' bg-' + this.weight; + cfg.cn = [ diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index bd66565324..3f07cebd4f 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -581,7 +581,9 @@ Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, { * @extends Roo.bootstrap.Component * Bootstrap Button class * @cfg {String} html The button content - * @cfg {String} weight (default | primary | success | info | warning | danger | link ) default + * @cfg {String} weight (default | primary | secondary | success | info | warning | danger | link ) default + * @cfg {String} badge_weight (default | primary | secondary | success | info | warning | danger | link ) default (same as button) + * @cfg {Boolean} outline default false (except for weight=default which emulates old behaveiour with an outline) * @cfg {String} size ( lg | sm | xs) * @cfg {String} tag ( a | input | submit) * @cfg {String} href empty or href @@ -607,7 +609,7 @@ Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, { Roo.bootstrap.Button = function(config){ Roo.bootstrap.Button.superclass.constructor.call(this, config); - this.weightClass = ["btn-default", + this.weightClass = ["btn-default btn-outline-secondary", "btn-primary", "btn-success", "btn-info", @@ -639,6 +641,8 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { html: false, active: false, weight: '', + badge_weight: '', + outline : false, size: '', tag: 'button', href: '', @@ -692,7 +696,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { ] }; - if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) { + if (['default', 'secondary' , 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) { cfg.cls += ' '+this.weight; } @@ -716,9 +720,15 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { //if (this.parentType != 'Navbar') { this.weight = this.weight.length ? this.weight : 'default'; //} - if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) { + if (['default', 'primary', 'secondary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) { - cfg.cls += ' btn-' + this.weight; + var outline = this.outline || this.weight == 'default' ? 'outline-' : ''; + var weight = this.weight == 'default' ? 'secondary' : this.weight; + cfg.cls += ' btn-' + outline + weight; + if (this.weight == 'default') { + // BC + cfg.cls += ' btn-' + this.weight; + } } } else if (this.theme==='glow') { @@ -807,12 +817,15 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { }; } + var bw = this.badge_weight.length ? this.badge_weight : + (this.weight.length ? this.weight : 'secondary'); + bw = bw == 'default' ? 'secondary' : bw; cfg.cn = [ value, { tag: 'span', - cls: 'badge', + cls: 'badge badge-' + bw, html: this.badge } ]; @@ -946,7 +959,13 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { setWeight : function(str) { this.el.removeClass(this.weightClass); - this.el.addClass('btn-' + str); + this.weight = str; + var outline = this.outline ? 'outline-' : ''; + if (str == 'default') { + this.el.addClass('btn-default btn-outline-secondary'); + return; + } + this.el.addClass('btn-' + outline + str); } @@ -3894,7 +3913,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { * * @cfg {String} tag (header|footer|nav|div) default is nav - * + * @cfg {String} weight (light|primary|secondary|success|danger|warning|info|dark|white) default is light. * * * @constructor @@ -3915,7 +3934,7 @@ Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar, { arrangement: '', align : false, - + weight : 'light', main : false, @@ -3928,8 +3947,13 @@ Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar, { var cfg = { tag : this.tag || 'div', - cls : 'navbar' + cls : 'navbar navbar-expand-lg' }; + if (['light','white'].indexOf(this.weight) > -1) { + cfg.cls += ['light','white'].indexOf(this.weight) > -1 ? ' navbar-light' : ' navbar-dark'; + } + cfg.cls += ' bg-' + this.weight; + cfg.cn = [ @@ -7982,7 +8006,7 @@ Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, { cls : '' }; if (this.parent().xtype.match(/^Nav/)) { - cfg.cls = 'navbar-form navbar-' + this.align; + cfg.cls = 'navbar-form form-inline navbar-' + this.align; } diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 02593df837..b481c4796a 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -23,20 +23,22 @@ Roo.bootstrap.ButtonGroup=function(A){Roo.bootstrap.ButtonGroup.superclass.const ;A.html=this.html||A.html;if(this.toolbar){A={cls:'btn-toolbar',html:null};return A;}if(['vertical','justified'].indexOf(this.align)!==-1){A.cls='btn-group-'+this.align;if(this.align=='justified'){console.log(this.items);}}if(['lg','sm','xs'].indexOf(this.size)!==-1){A.cls+=' btn-group-'+this.size; }if(this.direction=='up'){A.cls+=' dropup';}return A;},addItem:function(A){var cn=new Roo.bootstrap.Button(A);cn.parentId=this.id;cn.onRender(this.el,null);return cn;}}); // Roo/bootstrap/Button.js -Roo.bootstrap.Button=function(A){Roo.bootstrap.Button.superclass.constructor.call(this,A);this.weightClass=["btn-default","btn-primary","btn-success","btn-info","btn-warning","btn-danger","btn-link"],this.addEvents({"click":true,"toggle":true});};Roo.extend(Roo.bootstrap.Button,Roo.bootstrap.Component,{html:false,active:false,weight:'',size:'',tag:'button',href:'',disabled:false,isClose:false,glyphicon:'',badge:'',theme:'default',inverse:false,toggle:false,ontext:'ON',offtext:'OFF',defaulton:true,preventDefault:true,removeClass:false,name:false,target:false,pressed:null,getAutoCreate:function(){var A={tag:'button',cls:'roo-button',html:''} +Roo.bootstrap.Button=function(A){Roo.bootstrap.Button.superclass.constructor.call(this,A);this.weightClass=["btn-default btn-outline-secondary","btn-primary","btn-success","btn-info","btn-warning","btn-danger","btn-link"],this.addEvents({"click":true,"toggle":true} +);};Roo.extend(Roo.bootstrap.Button,Roo.bootstrap.Component,{html:false,active:false,weight:'',badge_weight:'',outline:false,size:'',tag:'button',href:'',disabled:false,isClose:false,glyphicon:'',badge:'',theme:'default',inverse:false,toggle:false,ontext:'ON',offtext:'OFF',defaulton:true,preventDefault:true,removeClass:false,name:false,target:false,pressed:null,getAutoCreate:function(){var A={tag:'button',cls:'roo-button',html:''} ;if(['a','button','input','submit'].indexOf(this.tag)<0){throw "Invalid value for tag: "+this.tag+". must be a, button, input or submit.";this.tag='button';}else{A.tag=this.tag;}A.html=''+(this.html||A.html)+'';if(this.toggle==true){A={tag:'div',cls:'slider-frame roo-button',cn:[{tag:'span','data-on-text':'ON','data-off-text':'OFF',cls:'slider-button',html:this.offtext} -]};if(['default','primary','success','info','warning','danger','link'].indexOf(this.weight)>-1){A.cls+=' '+this.weight;}return A;}if(this.isClose){A.cls+=' close';A["aria-hidden"]=true;A.html="×";return A;}if(this.theme==='default'){A.cls='btn roo-button'; -this.weight=this.weight.length?this.weight:'default';if(['default','primary','success','info','warning','danger','link'].indexOf(this.weight)>-1){A.cls+=' btn-'+this.weight;}}else if(this.theme==='glow'){A.tag='a';A.cls='btn-glow roo-button';if(['default','primary','success','info','warning','danger','link'].indexOf(this.weight)>-1){A.cls+=' '+this.weight; +]};if(['default','secondary','primary','success','info','warning','danger','link'].indexOf(this.weight)>-1){A.cls+=' '+this.weight;}return A;}if(this.isClose){A.cls+=' close';A["aria-hidden"]=true;A.html="×";return A;}if(this.theme==='default'){A.cls='btn roo-button'; +this.weight=this.weight.length?this.weight:'default';if(['default','primary','secondary','success','info','warning','danger','link'].indexOf(this.weight)>-1){var B=this.outline||this.weight=='default'?'outline-':'';var C=this.weight=='default'?'secondary':this.weight; +A.cls+=' btn-'+B+C;if(this.weight=='default'){A.cls+=' btn-'+this.weight;}}}else if(this.theme==='glow'){A.tag='a';A.cls='btn-glow roo-button';if(['default','primary','success','info','warning','danger','link'].indexOf(this.weight)>-1){A.cls+=' '+this.weight; }}if(this.inverse){this.cls+=' inverse';}if(this.active||this.pressed===true){A.cls+=' active';}if(this.disabled){A.disabled='disabled';}if(this.items){Roo.log('changing to ul');A.tag='ul';this.glyphicon='caret';}A.cls+=this.size.length?(' btn-'+this.size):''; if(this.parentType==='Navbar'&&!this.parent().bar){Roo.log('changing to li?');A.tag='li';A.cls='';A.cn=[{tag:'a',cls:'roo-button',html:this.html,href:this.href||'#'}];if(this.menu){A.cn[0].html=this.html+' ';A.cls+=' dropdown';} -delete A.html;}A.cls+=this.parentType==='Navbar'?' navbar-btn':'';if(this.glyphicon){A.html=' '+A.html;A.cn=[{tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon}];}if(this.badge){A.html+=' ';A.tag='a';A.href=this.href;var B=A.html;if(this.glyphicon){B={tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon,html:this.html} -;}A.cn=[B,{tag:'span',cls:'badge',html:this.badge}];A.html='';}if(this.menu){A.cls+=' dropdown';A.html=typeof(A.html)!='undefined'?A.html+' ':'';}if(A.tag!=='a'&&this.href!==''){throw "Tag must be a to set href."; -}else if(this.href.length>0){A.href=this.href;}if(this.removeClass){A.cls='';}if(this.target){A.target=this.target;}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;this.menu.triggerEl=this.el;this.addxtype(Roo.apply({} -,this.menu));}if(this.el.hasClass('roo-button')){this.el.on('click',this.onClick,this);}else{this.el.select('.roo-button').on('click',this.onClick,this);}if(this.removeClass){this.el.on('click',this.onClick,this);}this.el.enableDisplayMode();},onClick:function(e){if(this.disabled){return; -}Roo.log('button on click ');if(this.preventDefault){e.preventDefault();}if(this.pressed===true||this.pressed===false){this.toggleActive(e);}this.fireEvent('click',this,e);},enable:function(){this.disabled=false;this.el.removeClass('disabled');},disable:function(){this.disabled=true; -this.el.addClass('disabled');},setActive:function(v){this.el[v?'addClass':'removeClass']('active');this.pressed=v;},toggleActive:function(e){this.setActive(!this.pressed);this.fireEvent('toggle',this,e,!this.pressed);},isActive:function(){return this.el.hasClass('active'); -},setText:function(A){this.el.select('.roo-button-text',true).first().dom.innerHTML=A;},getText:function(){return this.el.select('.roo-button-text',true).first().dom.innerHTML;},setWeight:function(A){this.el.removeClass(this.weightClass);this.el.addClass('btn-'+A); -}}); +delete A.html;}A.cls+=this.parentType==='Navbar'?' navbar-btn':'';if(this.glyphicon){A.html=' '+A.html;A.cn=[{tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon}];}if(this.badge){A.html+=' ';A.tag='a';A.href=this.href;var D=A.html;if(this.glyphicon){D={tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon,html:this.html} +;}var bw=this.badge_weight.length?this.badge_weight:(this.weight.length?this.weight:'secondary');bw=bw=='default'?'secondary':bw;A.cn=[D,{tag:'span',cls:'badge badge-'+bw,html:this.badge}];A.html='';}if(this.menu){A.cls+=' dropdown';A.html=typeof(A.html)!='undefined'?A.html+' ':''; +}if(A.tag!=='a'&&this.href!==''){throw "Tag must be a to set href.";}else if(this.href.length>0){A.href=this.href;}if(this.removeClass){A.cls='';}if(this.target){A.target=this.target;}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype; +this.menu.triggerEl=this.el;this.addxtype(Roo.apply({},this.menu));}if(this.el.hasClass('roo-button')){this.el.on('click',this.onClick,this);}else{this.el.select('.roo-button').on('click',this.onClick,this);}if(this.removeClass){this.el.on('click',this.onClick,this); +}this.el.enableDisplayMode();},onClick:function(e){if(this.disabled){return;}Roo.log('button on click ');if(this.preventDefault){e.preventDefault();}if(this.pressed===true||this.pressed===false){this.toggleActive(e);}this.fireEvent('click',this,e);},enable:function(){this.disabled=false; +this.el.removeClass('disabled');},disable:function(){this.disabled=true;this.el.addClass('disabled');},setActive:function(v){this.el[v?'addClass':'removeClass']('active');this.pressed=v;},toggleActive:function(e){this.setActive(!this.pressed);this.fireEvent('toggle',this,e,!this.pressed); +},isActive:function(){return this.el.hasClass('active');},setText:function(A){this.el.select('.roo-button-text',true).first().dom.innerHTML=A;},getText:function(){return this.el.select('.roo-button-text',true).first().dom.innerHTML;},setWeight:function(A){this.el.removeClass(this.weightClass); +this.weight=A;var B=this.outline?'outline-':'';if(A=='default'){this.el.addClass('btn-default btn-outline-secondary');return;}this.el.addClass('btn-'+B+A);}}); // Roo/bootstrap/Column.js Roo.bootstrap.Column=function(A){Roo.bootstrap.Column.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Column,Roo.bootstrap.Component,{xs:false,sm:false,md:false,lg:false,xsoff:false,smoff:false,mdoff:false,lgoff:false,html:'',offset:0,alert:false,fa:false,icon:false,hidden:false,fasize:1,getAutoCreate:function(){var A=Roo.apply({} ,Roo.bootstrap.Column.superclass.getAutoCreate.call(this));A={tag:'div',cls:'column'};var B=this;['xs','sm','md','lg'].map(function(D){if(B[D+'off']!==false){A.cls+=' col-'+D+'-offset-'+B[D+'off'];}if(B[D]===false){return;}if(!B[D]){A.cls+=' hidden-'+D;return; @@ -152,9 +154,10 @@ Roo.bootstrap.Navbar=function(A){Roo.bootstrap.Navbar.superclass.constructor.cal 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.el.select('.collapse').getCount()){return this.el.select('.collapse',true).first(); }return this.el;},mask:function(){this.maskEl.show();},unmask:function(){this.maskEl.hide();}}); // Roo/bootstrap/NavSimplebar.js -Roo.bootstrap.NavSimplebar=function(A){Roo.bootstrap.NavSimplebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSimplebar,Roo.bootstrap.Navbar,{inverse:false,type:false,arrangement:'',align:false,main:false,tag:false,getAutoCreate:function(){var A={tag:this.tag||'div',cls:'navbar'} -;A.cn=[{cls:'nav',tag:'ul'}];this.type=this.type||'nav';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;}}); +Roo.bootstrap.NavSimplebar=function(A){Roo.bootstrap.NavSimplebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSimplebar,Roo.bootstrap.Navbar,{inverse:false,type:false,arrangement:'',align:false,weight:'light',main:false,tag:false,getAutoCreate:function(){var A={tag:this.tag||'div',cls:'navbar navbar-expand-lg'} +;if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;A.cn=[{cls:'nav',tag:'ul'}];this.type=this.type||'nav';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;}}); // Roo/bootstrap/NavHeaderbar.js Roo.bootstrap.NavHeaderbar=function(A){Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavHeaderbar,Roo.bootstrap.NavSimplebar,{position:'',brand:'',brand_href:false,srButton:true,autohide:false,desktopCenter:false,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar navbar-expand-md',role:'navigation',cn:[]} ;var cn=A.cn;if(this.desktopCenter){cn.push({cls:'container',cn:[]});cn=cn[0].cn;}if(this.srButton){cn.push({tag:'div',cls:'navbar-header',cn:[{tag:'button',type:'button',cls:'navbar-toggle navbar-toggler','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'} @@ -321,7 +324,7 @@ if(B===true||!B.success||!B.data){this.failureType=Roo.form.Action.LOAD_FAILURE; var B=rs.records&&rs.records[0]?rs.records[0].data:null;return {success:rs.success,data:B};}return Roo.decode(A.responseText);}});Roo.form.Action.ACTION_TYPES={'load':Roo.form.Action.Load,'submit':Roo.form.Action.Submit}; // Roo/bootstrap/Form.js Roo.bootstrap.Form=function(A){Roo.bootstrap.Form.superclass.constructor.call(this,A);Roo.bootstrap.Form.popover.apply();this.addEvents({clientvalidation:true,beforeaction:true,actionfailed:true,actioncomplete:true});};Roo.extend(Roo.bootstrap.Form,Roo.bootstrap.Component,{method:'POST',timeout:30,align:'left',activeAction:null,waitMsgTarget:false,loadMask:true,errorMask:false,maskOffset:100,maskBody:false,getAutoCreate:function(){var A={tag:'form',method:this.method||'POST',id:this.id||Roo.id(),cls:''} -;if(this.parent().xtype.match(/^Nav/)){A.cls='navbar-form navbar-'+this.align;}if(this.labelAlign=='left'){A.cls+=' form-horizontal';}return A;},initEvents:function(){this.el.on('submit',this.onSubmit,this);this.el.on('keypress',function(e){if(e.getCharCode()!=13){return true; +;if(this.parent().xtype.match(/^Nav/)){A.cls='navbar-form form-inline navbar-'+this.align;}if(this.labelAlign=='left'){A.cls+=' form-horizontal';}return A;},initEvents:function(){this.el.on('submit',this.onSubmit,this);this.el.on('keypress',function(e){if(e.getCharCode()!=13){return true; }if(e.getTarget().nodeName.toLowerCase()==='textarea'){return true;}Roo.log("keypress blocked");e.preventDefault();return false;});},onSubmit:function(e){e.stopEvent();},isValid:function(){var A=this.getItems();var B=true;var C=false;A.each(function(f){if(f.validate()){return; }Roo.log('invalid field: '+f.name);B=false;if(!C&&f.el.isVisible(true)){C=f;}});if(this.errorMask&&!B){Roo.bootstrap.Form.popover.mask(this,C);}return B;},isDirty:function(){var A=false;var B=this.getItems();B.each(function(f){if(f.isDirty()){A=true;return false; }return true;});return A;},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},beforeAction:function(A){var o=A.options;