roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Mon, 14 Dec 2020 05:05:58 +0000 (13:05 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 14 Dec 2020 05:05:58 +0000 (13:05 +0800)
roojs-bootstrap-debug.js
Roo/bootstrap/Input.js

Roo/bootstrap/Input.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index f61330f..cb17a7c 100644 (file)
@@ -489,7 +489,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
                     tag : 'i',
                     cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
                     tooltip : 'This field is required',
-                    style : this.allowBlank ? ' display:none' : '',
+                    style : this.allowBlank ? ' display:none' : '' 
                 },
                 {
                     tag: 'label',
@@ -515,7 +515,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
                         tag : 'i',
                         cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
                         tooltip : 'This field is required',
-                        style : this.allowBlank ? ' display:none' : '',
+                        style : this.allowBlank ? ' display:none' : '' 
                     },
 
                    inputblock
index 4b6c2ed..5ec71fb 100644 (file)
@@ -10590,7 +10590,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             tooltip : 'This field is required'
         };
         if (this.allowBlank ) {
-            indicator = { tag: 'i', cls : 'display-none' };
+            indicator.style = this.allowBlank ? ' display:none' : '';
         }
         if (align ==='left' && this.fieldLabel.length) {
             
@@ -10680,8 +10680,9 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             cfg.cn = [
                 {
                     tag : 'i',
-                    cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star' + (this.allowBlank ? ' display-none' : ''),
-                    tooltip : 'This field is required'
+                    cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
+                    tooltip : 'This field is required',
+                    style : this.allowBlank ? ' display:none' : '' 
                 },
                 {
                     tag: 'label',
@@ -10705,8 +10706,9 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
                     },
                     {
                         tag : 'i',
-                        cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star' + (this.allowBlank ? ' display-none' : ''),
-                        tooltip : 'This field is required'
+                        cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                        tooltip : 'This field is required',
+                        style : this.allowBlank ? ' display:none' : '' 
                     },
 
                    inputblock
index 24514c7..8b435cf 100644 (file)
@@ -432,12 +432,12 @@ var C={tag:'input',id:id,type:this.inputType,value:this.value,cls:'form-control'
 ;}if(this.before||this.after){E={cls:'input-group',cn:[]};if(this.before&&typeof(this.before)=='string'){E.cn.push({tag:'span',cls:'roo-input-before input-group-addon input-group-prepend input-group-text',html:this.before});}if(this.before&&typeof(this.before)=='object'){this.before=Roo.factory(this.before);
 E.cn.push({tag:'span',cls:'roo-input-before input-group-prepend   input-group-'+(this.before.xtype=='Button'?'btn':'addon')});}E.cn.push(C);if(this.after&&typeof(this.after)=='string'){E.cn.push({tag:'span',cls:'roo-input-after input-group-append input-group-text input-group-addon',html:this.after}
 );}if(this.after&&typeof(this.after)=='object'){this.after=Roo.factory(this.after);E.cn.push({tag:'span',cls:'roo-input-after input-group-append  input-group-'+(this.after.xtype=='Button'?'btn':'addon')});}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){E.cls+=' has-feedback';
-E.cn.push(F);}};var G={tag:'i',cls:'roo-required-indicator '+(this.indicatorpos=='right'?'right':'left')+'-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'};if(this.allowBlank){G={tag:'i',cls:'display-none'};}if(A==='left'&&this.fieldLabel.length){B.cls+=' roo-form-group-label-left'+(Roo.bootstrap.version==4?' row':'');
+E.cn.push(F);}};var G={tag:'i',cls:'roo-required-indicator '+(this.indicatorpos=='right'?'right':'left')+'-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'};if(this.allowBlank){G.style=this.allowBlank?' display:none':'';}if(A==='left'&&this.fieldLabel.length){B.cls+=' roo-form-group-label-left'+(Roo.bootstrap.version==4?' row':'');
 B.cn=[G,{tag:'label','for':id,cls:'control-label col-form-label',html:this.fieldLabel},{cls:"",cn:[E]}];var H=B.cn[1];var I=B.cn[2];if(this.indicatorpos=='right'){B.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel}
 ,G]},{cls:"",cn:[E]}];H=B.cn[0];I=B.cn[1];}if(this.labelWidth>12){H.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){H.cls+=' col-lg-'+this.labellg;I.cls+=' col-lg-'+(12-this.labellg);
 }if(this.labelmd>0){H.cls+=' col-md-'+this.labelmd;I.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){H.cls+=' col-sm-'+this.labelsm;I.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){H.cls+=' col-xs-'+this.labelxs;I.cls+=' col-xs-'+(12-this.labelxs);
-}}else if(this.fieldLabel.length){B.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star'+(this.allowBlank?' display-none':''),tooltip:'This field is required'},{tag:'label',html:this.fieldLabel},E];if(this.indicatorpos=='right'){B.cn=[{tag:'label',html:this.fieldLabel}
-,{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star'+(this.allowBlank?' display-none':''),tooltip:'This field is required'},E];}}else{B.cn=[E];};if(this.parentType==='Navbar'&&this.parent().bar){B.cls+=' navbar-form';}if(this.parentType==='NavGroup'&&!(Roo.bootstrap.version==4&&this.parent().form)){B.cls+=' navbar-form';
+}}else if(this.fieldLabel.length){B.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required',style:this.allowBlank?' display:none':''},{tag:'label',html:this.fieldLabel},E];if(this.indicatorpos=='right'){B.cn=[{tag:'label',html:this.fieldLabel}
+,{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required',style:this.allowBlank?' display:none':''},E];}}else{B.cn=[E];};if(this.parentType==='Navbar'&&this.parent().bar){B.cls+=' navbar-form';}if(this.parentType==='NavGroup'&&!(Roo.bootstrap.version==4&&this.parent().form)){B.cls+=' navbar-form';
 B.tag='li';}return B;},inputEl:function(){return this.el.select('input.form-control',true).first();},tooltipEl:function(){return this.inputEl();},indicatorEl:function(){if(Roo.bootstrap.version==4){return false;}var A=this.el.select('i.roo-required-indicator',true).first();
 if(!A){return false;}return A;},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.addClass(this.indicatorpos=='right'?'hidden':'invisible');}this.originalValue=this.getValue();if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);