From 5e911b879de9558aaac5d7b6da41ac8eef1a1c8b Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 28 May 2015 09:28:34 +0000 Subject: [PATCH] Bind the load event only once (.one), seems the jQuery(.on)+IE calls load event on an iframe twice --- mail/js/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index cccecb37f3..896f3a9d23 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -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); @@ -193,7 +194,7 @@ app.classes.mail = AppJS.extend( this.mail_isMainWindow = false; this.mail_display(); - + // Register attachments for drag this.register_for_drag( this.et2.getArrayMgr("content").getEntry('mail_id'), @@ -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();}); } },