Roo/bootstrap/Img.js
authoredward <edward@roojs.com>
Wed, 13 Jan 2016 03:25:27 +0000 (11:25 +0800)
committeredward <edward@roojs.com>
Wed, 13 Jan 2016 03:25:27 +0000 (11:25 +0800)
Roo/bootstrap/Img.js

index d0b7350..398b59f 100644 (file)
@@ -74,9 +74,30 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component,  {
                 src: this.xsUrl
             }
             
-            cfg.html = this.html || cfg.html;
-        
-            cfg.src = this.src || cfg.src;
+            if (['rounded','circle','thumbnail'].indexOf(this.border)>-1) {
+                cfg.cls += ' img-' + this.border;
+            }
+            
+            if(this.alt){
+                cfg.alt = this.alt;
+            }
+            
+            if(this.href){
+                var a = {
+                    tag: 'a',
+                    href: this.href,
+                    cn: [
+                        img
+                    ]
+                }
+
+                if(this.target){
+                    a.target = this.target;
+                }
+            }
+            
+            cfg.cn.push((this.href) ? a : img);
+
         }
         
     },