Bind the load event only once (.one), seems the jQuery(.on)+IE calls load event on an iframe twice

This commit is contained in:
Hadi Nategh 2015-05-28 09:28:34 +00:00
parent cffc879f04
commit 5e911b879d

View File

@ -184,7 +184,8 @@ app.classes.mail = AppJS.extend(
// Prepare display dialog for printing
// copies iframe content to a DIV, as iframe causes
// trouble for multipage printing
jQuery('iframe#mail-display_mailDisplayBodySrc').on('load', function()
jQuery('iframe#mail-display_mailDisplayBodySrc').one('load', function(e)
{
// encrypt body if mailvelope is available
self.mailvelopeAvailable(self.mailvelopeDisplay);
@ -798,7 +799,7 @@ app.classes.mail = AppJS.extend(
if (window.location.search.search('&print=') >= 0)
{
var that = this;
jQuery('#mail-display_mailDisplayBodySrc').bind('load',function(){that.mail_print();});
jQuery('iFrame#mail-display_mailDisplayBodySrc').one('load',function(){that.mail_print();});
}
},