w/resources/src/mediawiki.special/mediawiki.special.preferences.tabs.js
// This function is called onload and onhashchange.
This function is called onload and onhashchange.
This function is called onload and onhashchange .
function detectHash() {
			var hash = location.hash,
				matchedElement, parentSection;
			if ( hash.match( /^#mw-prefsection-[\w]+$/ ) ) {
				mw.storage.session.remove( 'mwpreferences-prevTab' );
				switchPrefTab( hash.replace( '#mw-prefsection-', '' ) );
			} else if ( hash.match( /^#mw-[\w-]+$/ ) ) {
				matchedElement = document.getElementById( hash.slice( 1 ) );
				parentSection = $( matchedElement ).parent().closest( '[id^="mw-prefsection-"]' );
				if ( parentSection.length ) {
					mw.storage.session.remove( 'mwpreferences-prevTab' );
					switchPrefTab( parentSection.attr( 'id' ).replace( 'mw-prefsection-', '' ), 'noHash' );
					matchedElement.scrollIntoView();
				}
			}
		}
function detectHash ( ) { var hash = location . hash , matchedElement , parentSection ; if ( hash . match ( / ^#mw-prefsection-[\w]+$ / ) ) { mw . storage . session . remove ( 'mwpreferences-prevTab' ) ; switchPrefTab ( hash . replace ( '#mw-prefsection-' , '' ) ) ; } else if ( hash . match ( / ^#mw-[\w-]+$ / ) ) { matchedElement = document . getElementById ( hash . slice ( 1 ) ) ; parentSection = $ ( matchedElement ) . parent ( ) . closest ( '[id^="mw-prefsection-"]' ) ; if ( parentSection . length ) { mw . storage . session . remove ( 'mwpreferences-prevTab' ) ; switchPrefTab ( parentSection . attr ( 'id' ) . replace ( 'mw-prefsection-' , '' ) , 'noHash' ) ; matchedElement . scrollIntoView ( ) ; } } }
This function is called onload and onhashchange.
This function is called onload and onhashchange .
// Switch to proper tab and scroll to selected item.