// T115692: The following is kept for backwards compatibility with older skins
$preferences.addClass( 'jsprefs' );
// T115692: The following is kept for backwards compatibility with older skins
$preferences.addClass( 'jsprefs' );
.parent().addClass( 'selected' );
$preferences.children( 'fieldset' ).hide().attr( 'aria-hidden', 'true' );
.parent().addClass( 'selected' );
$preferences.children( 'fieldset' ).hide().attr( 'aria-hidden', 'true' );
function detectHash() {
var hash = location.hash,
matchedElement, parentSection;
function detectHash() {
var hash = location.hash,
matchedElement, parentSection;
mw.storage.session.remove( 'mwpreferences-prevTab' );
switchPrefTab( hash.replace( '#mw-prefsection-', '' ) );
mw.storage.session.remove( 'mwpreferences-prevTab' );
switchPrefTab( hash.replace( '#mw-prefsection-', '' ) );
if ( parentSection.length ) {
mw.storage.session.remove( 'mwpreferences-prevTab' );
// Switch to proper tab and scroll to selected item.
if ( parentSection.length ) {
mw.storage.session.remove( 'mwpreferences-prevTab' );
// Switch to proper tab and scroll to selected item.
) {
$( window ).on( 'hashchange', function () {
var hash = location.hash;
) {
$( window ).on( 'hashchange', function () {
var hash = location.hash;
detectHash();
} else if ( hash === '' ) {
switchPrefTab( 'personal', 'noHash' );
}
} )
detectHash();
} else if ( hash === '' ) {
switchPrefTab( 'personal', 'noHash' );
}
} )
// In older browsers we'll bind a click handler as fallback.
// We must not have onhashchange *and* the click handlers, otherwise
// the click handler calls switchPrefTab() which sets the hash value,
// In older browsers we'll bind a click handler as fallback.
// We must not have onhashchange *and* the click handlers, otherwise
// the click handler calls switchPrefTab() which sets the hash value,