summaryrefslogtreecommitdiff
path: root/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js')
-rw-r--r--resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js33
1 files changed, 16 insertions, 17 deletions
diff --git a/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js b/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
index c9e55111..f217bf59 100644
--- a/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
+++ b/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
@@ -3,23 +3,22 @@
*/
/* Remember the collapse state of the legend on recent changes and watchlist pages. */
-jQuery( document ).ready( function ( $ ) {
+( function ( mw, $ ) {
var
cookieName = 'changeslist-state',
- cookieOptions = {
- expires: 30,
- path: '/'
- },
- isCollapsed = $.cookie( cookieName ) === 'collapsed';
+ // Expanded by default
+ isCollapsed = mw.cookie.get( cookieName ) === 'collapsed';
- $( '.mw-changeslist-legend' )
- .makeCollapsible( {
- collapsed: isCollapsed
- } )
- .on( 'beforeExpand.mw-collapsible', function () {
- $.cookie( cookieName, 'expanded', cookieOptions );
- } )
- .on( 'beforeCollapse.mw-collapsible', function () {
- $.cookie( cookieName, 'collapsed', cookieOptions );
- } );
-} );
+ $( function () {
+ $( '.mw-changeslist-legend' )
+ .makeCollapsible( {
+ collapsed: isCollapsed
+ } )
+ .on( 'beforeExpand.mw-collapsible', function () {
+ mw.cookie.set( cookieName, 'expanded' );
+ } )
+ .on( 'beforeCollapse.mw-collapsible', function () {
+ mw.cookie.set( cookieName, 'collapsed' );
+ } );
+ } );
+}( mediaWiki, jQuery ) );