From: Brad Jorsch Date: Tue, 20 Nov 2012 16:47:04 +0000 (-0500) Subject: (bug 41792) Fix Special:Preferences tabs in IE8 compatibility mode X-Git-Tag: 1.31.0-rc.0~21536^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=46a3587d546fc16c4bb4579b2da1ce46f5b71065;p=lhc%2Fweb%2Fwiklou.git (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 --- 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\-]+/ ) ) {