Roo/bootstrap/ComboBox.js
authorjohn <john@roojs.com>
Tue, 20 Feb 2018 03:57:15 +0000 (11:57 +0800)
committerjohn <john@roojs.com>
Tue, 20 Feb 2018 03:57:15 +0000 (11:57 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index 548b925..d7353ea 100644 (file)
@@ -2349,23 +2349,31 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                 cfg.cn = [
                     {
                         tag: 'label',
+                        'for' :  id,
                         cls : 'control-label',
-                        html : this.fieldLabel,
                         cn : [
                             {
-                               tag : 'i',
-                               cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
-                               tooltip : 'This field is required'
+                                tag : 'span',
+                                html : this.fieldLabel
+                            },
+                            {
+                                tag : 'i',
+                                cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                                tooltip : 'This field is required'
                             }
                         ]
                     },
                     {
-                        cls : '', 
+                        cls : "",
                         cn: [
                             combobox
                         ]
                     }
+
                 ];
+                
+                
+                
                 labelCfg = cfg.cn[0];
                 contentCfg = cfg.cn[1];
             }
index 39eee18..8e5b39e 100644 (file)
@@ -14698,23 +14698,31 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                 cfg.cn = [
                     {
                         tag: 'label',
+                        'for' :  id,
                         cls : 'control-label',
-                        html : this.fieldLabel,
                         cn : [
                             {
-                               tag : 'i',
-                               cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
-                               tooltip : 'This field is required'
+                                tag : 'span',
+                                html : this.fieldLabel
+                            },
+                            {
+                                tag : 'i',
+                                cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                                tooltip : 'This field is required'
                             }
                         ]
                     },
                     {
-                        cls : '', 
+                        cls : "",
                         cn: [
                             combobox
                         ]
                     }
+
                 ];
+                
+                
+                
                 labelCfg = cfg.cn[0];
                 contentCfg = cfg.cn[1];
             }
index c86b75e..9b5388b 100644 (file)
@@ -587,8 +587,8 @@ C.cn.push({tag:'button',html:'x',cls:'roo-combo-removable-btn close'});}if(this.
 );}var D={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},C]};if(this.multiple){D={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},{tag:'ul',cls:'roo-select2-choices',cn:[{tag:'li',cls:'roo-select2-search-field',cn:[C]}
 ]}]}};var E={cls:'roo-select2-container input-group roo-touchview-combobox ',cn:[D]};if(!this.multiple&&this.showToggleBtn){var F={tag:'span',cls:'caret'};if(this.caret!=false){F={tag:'i',cls:'fa fa-'+this.caret};}E.cn.push({tag:'span',cls:'input-group-addon btn dropdown-toggle',cn:[F,{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'}
 ]}]})}if(this.multiple){E.cls+=' roo-select2-container-multi';}var G=this.labelAlign||this.parentLabelAlign();if(G==='left'&&this.fieldLabel.length){A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}
-,{tag:'label',cls:'control-label',html:this.fieldLabel},{cls:'',cn:[E]}];var H=A.cn[1];var I=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label',cls:'control-label',html:this.fieldLabel,cn:[{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}
-]},{cls:'',cn:[E]}];H=A.cn[0];I=A.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);
+,{tag:'label',cls:'control-label',html:this.fieldLabel},{cls:'',cn:[E]}];var H=A.cn[1];var I=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label',cn:[{tag:'span',html:this.fieldLabel},{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}
+]},{cls:"",cn:[E]}];H=A.cn[0];I=A.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){A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},{tag:'label',cls:'control-label',html:this.fieldLabel},{cls:'',cn:[E]}];if(this.indicatorpos=='right'){A.cn=[{tag:'label',cls:'control-label',html:this.fieldLabel,cn:[{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}
 ]},{cls:'',cn:[E]}];}}else{A.cn=E;}var J=this;['xs','sm','md','lg'].map(function(K){if(J[K]){A.cls+=' col-'+K+'-'+J[K];}});return A;},initTouchView:function(){this.renderTouchView();this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.originalValue=this.getValue();