diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2014-04-10 16:57:42 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2014-04-10 16:57:42 +0200 |
commit | 467374ca12002fbcbe118b78f15b22e5fa85e721 (patch) | |
tree | eae258a43e13ae638333da081881e35ff39f0190 /program/js | |
parent | a2049621c7283f81fe50b78ab701ddf6a6bd5870 (diff) |
Avoid unexpected redirects to inbox after auto-saving a draft (#1489789)
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/program/js/app.js b/program/js/app.js index 095f16ee2..d8568ce47 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3681,9 +3681,12 @@ function rcube_webmail() $("input[name='_draft_saveid']").val(id); // reset history of hidden iframe used for saving draft (#1489643) - if (window.frames['savetarget'] && window.frames['savetarget'].history) { + // but don't do this on timer-triggered draft-autosaving (#1489789) + if (window.frames['savetarget'] && window.frames['savetarget'].history && !this.draft_autosave_submit) { window.frames['savetarget'].history.back(); } + + this.draft_autosave_submit = false; } // always remove local copy upon saving as draft @@ -3693,7 +3696,11 @@ function rcube_webmail() this.auto_save_start = function() { if (this.env.draft_autosave) - this.save_timer = setTimeout(function(){ ref.command("savedraft"); }, this.env.draft_autosave * 1000); + this.draft_autosave_submit = false; + this.save_timer = setTimeout(function(){ + ref.draft_autosave_submit = true; // set auto-saved flag (#1489789) + ref.command("savedraft"); + }, this.env.draft_autosave * 1000); // save compose form content to local storage every 5 seconds if (!this.local_save_timer && window.localStorage) { |