From 46c96bf0c0daacd1310d6e64f90045c51f846142 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 13 Jul 2017 15:39:48 +0200 Subject: [PATCH] Detach savetarget frame in onload or onerror .. because before it was detached too early causing some code from the iframe to be not executed. --- program/js/app.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 1eefee1bc..0cd69eab3 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -4753,9 +4753,6 @@ function rcube_webmail() $("input[name='_draft_saveid']").val(id); } - // Resetting savetarget frame to workaround issues with window history - this.save_target.detach(); - // always remove local copy upon saving as draft this.remove_compose_data(this.env.compose_id); this.compose_skip_unsavedcheck = false; @@ -4772,7 +4769,12 @@ function rcube_webmail() }); } - this.save_target.detach().attr('src', "about:blank").appendTo('body'); + this.save_target + .detach() + .attr('src', "about:blank") + .appendTo('body') + // Removing savetarget frame to workaround issues with window history + .on('load error', function() { $(this).detach(); }); return 'savetarget'; };