Merge "API: Fix prop=revisions&rvdiffto= without rvprop=content"
[lhc/web/wiklou.git] / resources / src / mediawiki.special / mediawiki.special.changeslist.legend.js
1 /*!
2 * Script for changes list legend
3 */
4
5 /* Remember the collapse state of the legend on recent changes and watchlist pages. */
6 jQuery( document ).ready( function ( $ ) {
7 var
8 cookieName = 'changeslist-state',
9 cookieOptions = {
10 expires: 30,
11 path: '/'
12 },
13 isCollapsed = $.cookie( cookieName ) === 'collapsed';
14
15 $( '.mw-changeslist-legend' )
16 .makeCollapsible( {
17 collapsed: isCollapsed
18 } )
19 .on( 'beforeExpand.mw-collapsible', function () {
20 $.cookie( cookieName, 'expanded', cookieOptions );
21 } )
22 .on( 'beforeCollapse.mw-collapsible', function () {
23 $.cookie( cookieName, 'collapsed', cookieOptions );
24 } );
25 } );