From 40f3c0b59813d467030d51948d518069141fd998 Mon Sep 17 00:00:00 2001 From: Gina Haeussge Date: Sun, 27 Jun 2010 12:25:15 +0200 Subject: FS#433: Editor now uses onbeforeunload event to capture ANY leaving of it besides via Save or Preview button. This has been successfully tested in FF, Chrome and IE6/7/8. Opera does not support onbeforeunload, therefore the draft is kept if the user navigates away from the editor. Please test this. --- lib/scripts/tw-sack.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/scripts/tw-sack.js') diff --git a/lib/scripts/tw-sack.js b/lib/scripts/tw-sack.js index cfcbe0ea9..b5a5c8861 100644 --- a/lib/scripts/tw-sack.js +++ b/lib/scripts/tw-sack.js @@ -10,6 +10,7 @@ function sack(file){ this.URLString = ""; this.encodeURIString = true; this.execute = false; + this.asynchronous = true; this.onLoading = function() { }; this.onLoaded = function() { }; @@ -86,9 +87,9 @@ function sack(file){ var self = this; if (this.method == "GET") { var totalurlstring = this.requestFile + "?" + this.URLString; - this.xmlhttp.open(this.method, totalurlstring, true); + this.xmlhttp.open(this.method, totalurlstring, this.asynchronous); } else { - this.xmlhttp.open(this.method, this.requestFile, true); + this.xmlhttp.open(this.method, this.requestFile, this.asynchronous); } if (this.method == "POST"){ try { -- cgit v1.2.3