mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-09 08:25:03 +02:00
Don't send a location header if we currently handle an ajax response/request - use the corresponding json function instead. Doing this on the server side is neccessary as the location header is one of the few ones which is handled by the browser before any XMLHttpRequest event is fired (according to W3C specification)
This commit is contained in:
@ -226,12 +226,21 @@ function egw_json_request(_menuaction, _parameters, _context)
|
||||
this.onLoadFinish = null;
|
||||
this.loadedJSFiles = {};
|
||||
this.handleResponseDone = false;
|
||||
this.app = null;
|
||||
if (window.egw_alertHandler)
|
||||
{
|
||||
this.alertHandler = window.egw_alertHandler;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the "application" object which is passed to egw_appWindowOpen when a redirect is done
|
||||
*/
|
||||
egw_json_request.prototype.setAppObject = function(_app)
|
||||
{
|
||||
this.app = _app;
|
||||
}
|
||||
|
||||
egw_json_request.prototype._assembleAjaxUrl = function(_menuaction)
|
||||
{
|
||||
// Retrieve the webserver url
|
||||
@ -423,7 +432,7 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe
|
||||
}
|
||||
else
|
||||
{
|
||||
window.location.href = res.data.url;
|
||||
egw_appWindowOpen(this.app, res.data.url);
|
||||
}
|
||||
|
||||
hasResponse = true;
|
||||
|
Reference in New Issue
Block a user