Merge "i18n: Drop img-auth-nologinnWL, unused AFAICT"
[lhc/web/wiklou.git] / resources / src / mediawiki.action / mediawiki.action.edit.collapsibleFooter.js
index 2506ffe..a8ea6b8 100644 (file)
@@ -1,4 +1,4 @@
-( function ( mw ) {
+( function () {
        var collapsibleLists, handleOne;
 
        // Collapsible lists of categories and templates
        ];
 
        handleOne = function ( $list, $toggler, storeKey ) {
-               // Collapsed by default
-               var isCollapsed = mw.storage.get( storeKey ) !== 'expanded';
+               var collapsedVal = '0',
+                       expandedVal = '1',
+                       // Default to collapsed if not set
+                       isCollapsed = mw.storage.get( storeKey ) !== expandedVal;
 
                // Style the toggler with an arrow icon and add a tabIndex and a role for accessibility
                $toggler.addClass( 'mw-editfooter-toggler' ).prop( 'tabIndex', 0 ).attr( 'role', 'button' );
 
                $list.on( 'beforeExpand.mw-collapsible', function () {
                        $toggler.removeClass( 'mw-icon-arrow-collapsed' ).addClass( 'mw-icon-arrow-expanded' );
-                       mw.storage.set( storeKey, 'expanded' );
+                       mw.storage.set( storeKey, expandedVal );
                } );
 
                $list.on( 'beforeCollapse.mw-collapsible', function () {
                        $toggler.removeClass( 'mw-icon-arrow-expanded' ).addClass( 'mw-icon-arrow-collapsed' );
-                       mw.storage.set( storeKey, 'collapsed' );
+                       mw.storage.set( storeKey, collapsedVal );
                } );
        };
 
@@ -61,4 +63,4 @@
                        );
                }
        } );
-}( mediaWiki ) );
+}() );