From 46a3587d546fc16c4bb4579b2da1ce46f5b71065 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 20 Nov 2012 11:47:04 -0500 Subject: [PATCH] (bug 41792) Fix Special:Preferences tabs in IE8 compatibility mode It seems that IE8 lies about supporting "onhashchange" with the standard feature test when in compatibility mode. So, sadly, we must add in an explicit browser check if we want this to work. Change-Id: Ib2c1b150acd0a0b5b16604e8623d6aa78017a9a0 --- resources/mediawiki.special/mediawiki.special.preferences.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/mediawiki.special/mediawiki.special.preferences.js b/resources/mediawiki.special/mediawiki.special.preferences.js index 989a986b22..d8d092b6b6 100644 --- a/resources/mediawiki.special/mediawiki.special.preferences.js +++ b/resources/mediawiki.special/mediawiki.special.preferences.js @@ -79,7 +79,10 @@ jQuery( document ).ready( function ( $ ) { // will naturally set the hash, handled by onhashchange. // But other things that change the hash will also be catched (e.g. using // the Back and Forward browser navigation). - if ( 'onhashchange' in window ) { + // Note the special check for IE "compatibility" mode. + if ( 'onhashchange' in window && + ( document.documentMode === undefined || document.documentMode >= 8 ) + ) { $(window).on( 'hashchange' , function () { var hash = window.location.hash; if ( hash.match( /^#mw-prefsection-[\w\-]+/ ) ) { -- 2.20.1