BUGFIX Don't replace pushState() if emulated, as it will re-load the new URL via ajax, effectively duplicating every request in IE (#7002)

This commit is contained in:
Ingo Schommer 2012-03-30 15:57:54 +02:00
parent 83adffd7cd
commit 1091c7b944
2 changed files with 8 additions and 5 deletions

View File

@ -160,7 +160,8 @@
}
// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it.
if(window.History.enabled) {
// Causes non-pushState browser to re-request the URL, so ignore for those.
if(window.History.enabled && !History.emulated.pushState) {
var url = xmlhttp.getResponseHeader('X-ControllerURL');
if(url) window.History.replaceState({}, '', url);
}

View File

@ -88,7 +88,8 @@ jQuery.noConflict();
$('.cms-edit-form').live('reloadeditform', function(e, data) {
// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it
if(window.History.enabled) {
// Causes non-pushState browser to re-request the URL, so ignore for those.
if(window.History.enabled && !History.emulated.pushState) {
var url = data.xmlhttp.getResponseHeader('X-ControllerURL');
if(url) window.history.replaceState({}, '', url);
}
@ -250,8 +251,9 @@ jQuery.noConflict();
newContentEl.css('visibility', 'visible');
newContentEl.removeClass('loading');
// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it
if(window.History.enabled) {
// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it.
// Causes non-pushState browser to re-request the URL, so ignore for those.
if(window.History.enabled && !History.emulated.pushState) {
var url = xhr.getResponseHeader('X-ControllerURL');
if(url) window.History.replaceState({}, '', url);
}