Added handling for global redirect and handling of ?cd=10 in redirect url, which should trigger the url to be loaded inside the top window

This commit is contained in:
Andreas Stöckel
2010-06-11 08:08:07 +00:00
parent e513532840
commit 04267ed34d
2 changed files with 23 additions and 5 deletions

View File

@ -229,9 +229,21 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe
}
break;
case 'redirect':
if (typeof res.data == 'string')
if (typeof res.data.url == 'string' &&
typeof res.data.global == 'boolean')
{
window.location.href = res.data;
//Special handling for framework reload
if (res.data.url.indexOf("?cd=10") > 0)
res.data.global = true;
if (res.data.global)
{
egw_topWindow().location.href = res.data.url;
}
else
{
window.location.href = res.data.url;
}
}
break;
}