X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Roo%2Fbootstrap%2FImg.js;fp=Roo%2Fbootstrap%2FImg.js;h=0226544263a2cbecbfa262ea37ad66dfa8b067d7;hp=9e32c01bef5d13356447289cfdc72b51dfc7ab52;hb=1016d7d5e1428817482299b73d08b8ea8065869a;hpb=a7fcc817e87efee74d7957d62881129164d7c510 diff --git a/Roo/bootstrap/Img.js b/Roo/bootstrap/Img.js index 9e32c01bef..0226544263 100644 --- a/Roo/bootstrap/Img.js +++ b/Roo/bootstrap/Img.js @@ -36,7 +36,13 @@ Roo.bootstrap.Img = function(config){ * 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 }); }; @@ -161,7 +167,7 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { if(!this.href){ this.el.on('click', this.onClick, this); } - + this.el.select('img', true).on('load', this.onImageLoad, this); }, onClick : function(e) @@ -169,6 +175,12 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { 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