Skip to content
This repository
Browse code

BUGFIX Don't replace pushState() if emulated, as it will re-load the …

…new URL via ajax, effectively duplicating every request in IE (#7002)
  • Loading branch information...
commit 1091c7b9441e289d7f76a0d138ecaba9d0231c07 1 parent 83adffd
Ingo Schommer authored
3  admin/javascript/LeftAndMain.Content.js
@@ -160,7 +160,8 @@
160 160
 						}
161 161
 
162 162
 						// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it.
163  
-						if(window.History.enabled) {
  163
+						// Causes non-pushState browser to re-request the URL, so ignore for those.
  164
+						if(window.History.enabled && !History.emulated.pushState) {
164 165
 							var url = xmlhttp.getResponseHeader('X-ControllerURL');
165 166
 							if(url) window.History.replaceState({}, '', url);
166 167
 						}
10  admin/javascript/LeftAndMain.js
@@ -88,7 +88,8 @@ jQuery.noConflict();
88 88
 				
89 89
 				$('.cms-edit-form').live('reloadeditform', function(e, data) {
90 90
 					// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it
91  
-					if(window.History.enabled) {
  91
+					// Causes non-pushState browser to re-request the URL, so ignore for those.
  92
+					if(window.History.enabled && !History.emulated.pushState) {
92 93
 						var url = data.xmlhttp.getResponseHeader('X-ControllerURL');
93 94
 						if(url) window.history.replaceState({}, '', url);
94 95
 					}
@@ -250,12 +251,13 @@ jQuery.noConflict();
250 251
 						newContentEl.css('visibility', 'visible');
251 252
 						newContentEl.removeClass('loading');
252 253
 
253  
-						// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it
254  
-						if(window.History.enabled) {
  254
+						// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it.
  255
+						// Causes non-pushState browser to re-request the URL, so ignore for those.
  256
+						if(window.History.enabled && !History.emulated.pushState) {
255 257
 							var url = xhr.getResponseHeader('X-ControllerURL');
256 258
 							if(url) window.History.replaceState({}, '', url);
257 259
 						}
258  
-						
  260
+
259 261
 						self.trigger('afterstatechange', {data: data, status: status, xhr: xhr, element: newContentEl});
260 262
 					},
261 263
 					error: function(xhr, status, e) {

0 notes on commit 1091c7b

Please sign in to comment.
Something went wrong with that request. Please try again.