diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index d409715d6..5107b2168 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -3321,16 +3321,19 @@ function rcube_elastic_ui() function image_upload_input(obj) { var reset_button = $('') - .attr({'class': 'icon button delete', href: '#', }) - .click(function(e) { rcmail.command('delete-photo', '', this, e); return false; }); + .attr({'class': 'icon button delete', href: '#', }) + .click(function(e) { rcmail.command('delete-photo', '', this, e); return false; }), + img = $(obj).find('img')[0], + img_onload = function() { + var state = (img.currentSrc || img.src).indexOf(rcmail.env.photo_placeholder) != -1; + $(obj)[state ? 'removeClass' : 'addClass']('changed'); + }; $(obj).append(reset_button).click(function() { rcmail.upload_input('upload-form'); }); - $('img', obj).on('load', function() { - // FIXME: will that work in IE? - var state = (this.currentSrc || this.src).indexOf(rcmail.env.photo_placeholder) != -1; - $(obj)[state ? 'removeClass' : 'addClass']('changed'); - }); + // Note: Looks like only Firefox does not need this separate call + img_onload(); + $(img).on('load', img_onload); }; /**