Skip to content
This repository
Browse code

BUGFIX Force full window reload on IE7/IE8 every 20 pushState request…

…s (see #7258)
  • Loading branch information...
commit ecb48bb57c3b9ce42f527f2aaca638e89b6d30c0 1 parent 7ba759e
Ingo Schommer authored June 14, 2012

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  admin/javascript/LeftAndMain.js
11  admin/javascript/LeftAndMain.js
@@ -69,6 +69,8 @@ jQuery.noConflict();
69 69
 		$('.cms-container').entwine({
70 70
 			
71 71
 			CurrentXHR: null,
  72
+
  73
+			StateChangeCount: 0,
72 74
 			
73 75
 			/**
74 76
 			 * Constructor: onmatch
@@ -285,6 +287,15 @@ jQuery.noConflict();
285 287
 				var self = this, h = window.History, state = h.getState(),
286 288
 					fragments = state.data.pjax || 'Content', headers = {},
287 289
 					contentEls = this._findFragments(fragments.split(','));
  290
+
  291
+				// For legacy IE versions (IE7 and IE8), reload without ajax
  292
+				// as a crude way to fix memory leaks through whole window refreshes.
  293
+				this.setStateChangeCount(this.getStateChangeCount() + 1);
  294
+				var isLegacyIE = ($.browser.msie && parseInt($.browser.version, 10) < 9);
  295
+				if(isLegacyIE && this.getStateChangeCount() > 20) {
  296
+					document.location.href = state.url;
  297
+					return;
  298
+				}
288 299
 				
289 300
 				this.trigger('beforestatechange', {state: state, element: contentEls});
290 301
 

0 notes on commit ecb48bb

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