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:
@@ -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);
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
@@ -447,5 +447,12 @@
|
||||
* XMLHttpRequest object. From
|
||||
* http://code.google.com/p/xmlhttprequest/.
|
||||
*/
|
||||
if (!OpenLayers.Request) {
|
||||
/**
|
||||
* This allows for OpenLayers/Request.js to be included
|
||||
* before or after this script.
|
||||
*/
|
||||
OpenLayers.Request = {};
|
||||
}
|
||||
OpenLayers.Request.XMLHttpRequest = cXMLHttpRequest;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user