Fix Selenium tests
[mediawiki.git] / resources / src / mediawiki.special / mediawiki.special.changeslist.legend.js
blobf217bf59aa2e1d3840a2c218fdc85f71da1030c3
1 /*!
2 * Script for changes list legend
3 */
5 /* Remember the collapse state of the legend on recent changes and watchlist pages. */
6 ( function ( mw, $ ) {
7 var
8 cookieName = 'changeslist-state',
9 // Expanded by default
10 isCollapsed = mw.cookie.get( cookieName ) === 'collapsed';
12 $( function () {
13 $( '.mw-changeslist-legend' )
14 .makeCollapsible( {
15 collapsed: isCollapsed
16 } )
17 .on( 'beforeExpand.mw-collapsible', function () {
18 mw.cookie.set( cookieName, 'expanded' );
19 } )
20 .on( 'beforeCollapse.mw-collapsible', function () {
21 mw.cookie.set( cookieName, 'collapsed' );
22 } );
23 } );
24 }( mediaWiki, jQuery ) );