mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Force full window reload on IE7/IE8 every 20 pushState requests (see #7258)
This commit is contained in:
parent
7ba759e77b
commit
ecb48bb57c
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user