Roo/bootstrap/Input.js
authorjohn <john@roojs.com>
Fri, 18 May 2018 04:08:30 +0000 (12:08 +0800)
committerjohn <john@roojs.com>
Fri, 18 May 2018 04:08:30 +0000 (12:08 +0800)
Roo/bootstrap/Input.js

index e9316fc..1fd7ee1 100644 (file)
@@ -1020,22 +1020,23 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         
         if(this.indicator){
             var ar = this.el.select('label > span',true);
-            if (!ar.elements.length) {
-                $br = this.el.select('label');
-                if(!br.elements.length) {
-                    Roo.log("could not find label element");
-                    Roo.log(this);
-                    return;
-                }
-                Roo.log("could not find label > span on element");
-                Roo.log(this);
+            
+            if (ar.elements.length) {
+                this.el.select('label > span',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
                 return;
             }
-            this.el.select('label > span',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
-            return;
+            
+            var br = this.el.select('label',true);
+            
+            if(br.elements.length) {
+                this.el.select('label',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+                return;
+            }
+            
+            Roo.log('Cannot Found any of label > span || label in input');
         }
         
-        this.el.select('label',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+        
     }
 });