[fusion-commits] r3036 - sandbox/cms_refactor/lib
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Jul 26 06:56:44 PDT 2018
Author: jng
Date: 2018-07-26 06:56:43 -0700 (Thu, 26 Jul 2018)
New Revision: 3036
Modified:
sandbox/cms_refactor/lib/fusion.js
Log:
Don't use synchronous XmlHttpRequest for create session
Modified: sandbox/cms_refactor/lib/fusion.js
===================================================================
--- sandbox/cms_refactor/lib/fusion.js 2018-07-26 13:51:45 UTC (rev 3035)
+++ sandbox/cms_refactor/lib/fusion.js 2018-07-26 13:56:43 UTC (rev 3036)
@@ -1659,19 +1659,29 @@
params += "&password=" + pass;
}
}
- xhr.open("POST", url, false);
- xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- xhr.send(params);
-
- var o = Fusion.parseJSON(xhr.responseText);
- Fusion.sessionId = o.sessionId;
- var version = o.siteVersion;
- var bits = version.split('.');
- Fusion.siteVersion = new Array(parseInt(bits[0]),
- parseInt(bits[1]),
- parseInt(bits[2]),
- parseInt(bits[3])
- );
+ xhr.open("POST", url, true);
+ xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ xhr.onload = function (e) {
+ if (xhr.readyState === 4) {
+ if (xhr.status === 200) {
+ var o = Fusion.parseJSON(xhr.responseText);
+ Fusion.sessionId = o.sessionId;
+ var version = o.siteVersion;
+ var bits = version.split('.');
+ Fusion.siteVersion = new Array(parseInt(bits[0]),
+ parseInt(bits[1]),
+ parseInt(bits[2]),
+ parseInt(bits[3])
+ );
+ } else {
+ console.error(xhr.statusText);
+ }
+ }
+ };
+ xhr.onerror = function (e) {
+ console.error(xhr.statusText);
+ };
+ xhr.send(params);
}
var appDefUrl = Fusion.getQueryParam('ApplicationDefinition');
More information about the fusion-commits
mailing list