Allow for circular dependency in XMLHttpRequest.js

To make custom builds easier, it's convenient to have a OpenLayers.Request depend on OpenLayers.Request.XMLHttpRequest (see 18b4d6808d).  This makes it so we don't know which is going to be included first.  To get around this, we can be careful about when we define OpenLayers.Request.
This commit is contained in:
Tim Schaub
2012-05-11 17:41:24 -06:00
parent 866fa443fe
commit cb7cf5e18e
2 changed files with 16 additions and 2 deletions

View File

@@ -20,7 +20,14 @@ OpenLayers.ProxyHost = "";
* with XMLHttpRequests. These methods work with a cross-browser
* W3C compliant <OpenLayers.Request.XMLHttpRequest> class.
*/
OpenLayers.Request = {
if (!OpenLayers.Requst) {
/**
* This allows for OpenLayers/Request/XMLHttpRequest.js to be included
* before or after this script.
*/
OpenLayers.Request = {};
}
OpenLayers.Util.extend(OpenLayers.Request, {
/**
* Constant: DEFAULT_CONFIG
@@ -420,4 +427,4 @@ OpenLayers.Request = {
return OpenLayers.Request.issue(config);
}
};
});