BUGFIX Force full window reload on IE7/IE8 every 20 pushState requests (see #7258)

This commit is contained in:
Ingo Schommer 2012-06-14 18:23:54 +02:00
parent 7ba759e77b
commit ecb48bb57c

View File

@ -70,6 +70,8 @@ jQuery.noConflict();
CurrentXHR: null,
StateChangeCount: 0,
/**
* Constructor: onmatch
*/
@ -286,6 +288,15 @@ jQuery.noConflict();
fragments = state.data.pjax || 'Content', headers = {},
contentEls = this._findFragments(fragments.split(','));
// For legacy IE versions (IE7 and IE8), reload without ajax
// as a crude way to fix memory leaks through whole window refreshes.
this.setStateChangeCount(this.getStateChangeCount() + 1);
var isLegacyIE = ($.browser.msie && parseInt($.browser.version, 10) < 9);
if(isLegacyIE && this.getStateChangeCount() > 20) {
document.location.href = state.url;
return;
}
this.trigger('beforestatechange', {state: state, element: contentEls});
// Set Pjax headers, which can declare a preference for the returned view.