* The img click event for the img.
* @param {Roo.EventObject} e
*/
- "click" : true
+ "click" : true,
+ /**
+ * @event load
+ * The when any image loads
+ * @param {Roo.EventObject} e
+ */
+ "load" : true
});
};
if(!this.href){
this.el.on('click', this.onClick, this);
}
-
+ this.el.select('img', true).on('load', this.onImageLoad, this);
},
onClick : function(e)
Roo.log('img onclick');
this.fireEvent('click', this, e);
},
+ onImageLoad: function(e)
+ {
+ Roo.log('img load');
+ this.fireEvent('load', this, e);
+ },
+
+ /**
+ * Sets the url of the image - used to update it
+ * @param {String} url the url of the image
+ */
setSrc : function(url)
{
- this.el.dom.src = url;
+ this.src = url;
+
+ if(this.src || (!this.xsUrl && !this.smUrl && !this.mdUrl && !this.lgUrl)){
+ this.el.dom.src = url;
+ return;
+ }
+
+ this.el.select('img', true).first().dom.src = url;
}