Roo/bootstrap/Img.js
authorEdward <edward@roojs.com>
Fri, 21 Mar 2014 05:21:20 +0000 (13:21 +0800)
committerEdward <edward@roojs.com>
Fri, 21 Mar 2014 05:21:20 +0000 (13:21 +0800)
Roo/bootstrap/Img.js

index 5904125..f594b2b 100644 (file)
@@ -39,7 +39,7 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component,  {
     imgResponsive: true,
     border: '',
     src: '',
-    href: '',
+    href: false,
 
     getAutoCreate : function(){
         
@@ -49,6 +49,21 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component,  {
             html : null
         }
         
+        if(this.href){
+            cfg = {
+                tag: 'a',
+                href: this.href,
+                cn: [
+                   {
+                        tag: 'img',
+                       cls: 'img-responsive',
+                        html : null
+                   }
+               ]
+            }
+            
+        }
+        
         cfg.html = this.html || cfg.html;
         
         cfg.src = this.src || cfg.src;