[Mapbender-commits] r5300 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jan 8 07:51:52 EST 2010


Author: verenadiewald
Date: 2010-01-08 07:51:52 -0500 (Fri, 08 Jan 2010)
New Revision: 5300

Modified:
   trunk/mapbender/lib/ajax.js
Log:
possibility to set async in ajaxSetup to false

Modified: trunk/mapbender/lib/ajax.js
===================================================================
--- trunk/mapbender/lib/ajax.js	2010-01-08 12:49:22 UTC (rev 5299)
+++ trunk/mapbender/lib/ajax.js	2010-01-08 12:51:52 UTC (rev 5300)
@@ -62,18 +62,28 @@
 		var type = (options.type) ? options.type.toUpperCase() : "POST";
 		var log = (options.log) ? options.log : false;
 		var method = (options.method) ? options.method : "";
+		var async = (typeof options.async === "boolean") ? options.async : true;
 		var parameters = (options.parameters) ? options.parameters : {};
 	}
 	 
 	this.send = function () {
+		$.ajaxSetup({
+			async: async
+		});
 		switch (type.toUpperCase()) {
 			case "POST" :
 				$.post(url, getParameters(), function () {
 				});
+				$.ajaxSetup({
+					async: true
+				});
 				break;
 			case "GET" :
 				$.get(url, getParameters(), function () {
 				});
+				$.ajaxSetup({
+					async: true
+				});
 				break;
 			default:
 				new Mapbender.Exception("Invalid type (" + type + 
@@ -130,6 +140,7 @@
 		var parameters = (options.parameters) ? options.parameters : {};
 		var callback = (options.callback) ? options.callback : null;
 		var scope = (options.scope) ? options.scope : null;
+		var async = (typeof options.async === "boolean") ? options.async : true;
 	}
 	else {
 		new Mapbender.Exception("No options specified in " + 
@@ -248,12 +259,21 @@
 				}
 			}
 		};
+		$.ajaxSetup({
+			async: async
+		});
 		switch (type) {
 			case "POST" :
 				$.post(url, getParameters(), callbackWrapper);
+				$.ajaxSetup({
+					async: true
+				});
 				break;
 			case "GET" :
 				$.get(url, getParameters(), callbackWrapper);
+				$.ajaxSetup({
+					async: true
+				});
 				break;
 			default:
 				return false;



More information about the Mapbender_commits mailing list