Merge "Show total number of autoblocks on top of Special:AutoblockList"
[lhc/web/wiklou.git] / resources / src / mediawiki.special / mediawiki.special.preferences.js
index 0fa6610..84a9a96 100644 (file)
                        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 ).closest( '.prefsection' );
                                if ( parentSection.length ) {
+                                       mw.storage.session.remove( 'mwpreferences-prevTab' );
                                        // Switch to proper tab and scroll to selected item.
                                        switchPrefTab( parentSection.attr( 'id' ).replace( 'mw-prefsection-', '' ), 'noHash' );
                                        matchedElement.scrollIntoView();
                if ( previousTab ) {
                        switchPrefTab( previousTab, 'noHash' );
                        // Deleting the key, the tab states should be reset until we press Save
-                       mw.storage.session.remove( previousTab );
+                       mw.storage.session.remove( 'mwpreferences-prevTab' );
                }
 
                $( '#mw-prefs-form' ).on( 'submit', function () {