Roo/bootstrap/FieldLabel.js
authorEdward <edward@roojs.com>
Mon, 17 Sep 2018 06:56:01 +0000 (14:56 +0800)
committerEdward <edward@roojs.com>
Mon, 17 Sep 2018 06:56:01 +0000 (14:56 +0800)
Roo/bootstrap/FieldLabel.js

index d96502f..e692a94 100644 (file)
@@ -59,20 +59,16 @@ Roo.extend(Roo.bootstrap.FieldLabel, Roo.bootstrap.Component,  {
     getAutoCreate : function(){
         
        var cls = "";
+        
        if (!this.allowBlank) {
            cls  = "visible";
        }
-       
+        
         var cfg = {
             tag : this.tag,
             cls : 'roo-bootstrap-field-label ' + this.cls,
             for : this.target,
             cn : [
-                {
-                    tag : 'i',
-                    cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star ' + cls,
-                    tooltip : this.iconTooltip
-                },
                 {
                     tag : 'span',
                     html : this.html
@@ -80,25 +76,45 @@ Roo.extend(Roo.bootstrap.FieldLabel, Roo.bootstrap.Component,  {
             ] 
         };
         
-        if(this.indicatorpos == 'right'){
+        if(!this.allowBlank){
+            
             var cfg = {
                 tag : this.tag,
                 cls : 'roo-bootstrap-field-label ' + this.cls,
                 for : this.target,
                 cn : [
-                    {
-                        tag : 'span',
-                        html : this.html
-                    },
                     {
                         tag : 'i',
-                        cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star '+ cls,
+                        cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star ' + cls,
                         tooltip : this.iconTooltip
+                    },
+                    {
+                        tag : 'span',
+                        html : this.html
                     }
                 ] 
             };
+
+            if(this.indicatorpos == 'right'){
+                var cfg = {
+                    tag : this.tag,
+                    cls : 'roo-bootstrap-field-label ' + this.cls,
+                    for : this.target,
+                    cn : [
+                        {
+                            tag : 'span',
+                            html : this.html
+                        },
+                        {
+                            tag : 'i',
+                            cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star '+ cls,
+                            tooltip : this.iconTooltip
+                        }
+                    ] 
+                };
+            }
         }
-        
+       
         return cfg;
     },