build: Update eslint-config-wikimedia to 0.10.0
[lhc/web/wiklou.git] / resources / src / mediawiki.toc / toc.js
index 4c201a6..85dbf97 100644 (file)
@@ -1,4 +1,4 @@
-( function ( mw, $ ) {
+( function () {
        'use strict';
 
        // Table of contents toggle
                        // Hide/show the table of contents element
                        function toggleToc() {
                                if ( $tocList.is( ':hidden' ) ) {
+                                       // FIXME: Use CSS transitions
+                                       // eslint-disable-next-line jquery/no-slide
                                        $tocList.slideDown( 'fast' );
                                        $tocToggleLink.text( mw.msg( 'hidetoc' ) );
                                        $this.removeClass( 'tochidden' );
                                        mw.cookie.set( 'hidetoc', null );
                                } else {
+                                       // eslint-disable-next-line jquery/no-slide
                                        $tocList.slideUp( 'fast' );
                                        $tocToggleLink.text( mw.msg( 'showtoc' ) );
                                        $this.addClass( 'tochidden' );
                        if ( !$tocToggleCheckbox.length && $tocTitle.length && $tocList.length && !$tocToggleLink.length ) {
                                hideToc = mw.cookie.get( 'hidetoc' ) === '1';
 
-                               $tocToggleLink = $( '<a role="button" tabindex="0" class="togglelink"></a>' )
+                               $tocToggleLink = $( '<a>' )
+                                       .attr( {
+                                               role: 'button',
+                                               tabindex: 0
+                                       } )
+                                       .addClass( 'togglelink' )
                                        .text( mw.msg( hideToc ? 'showtoc' : 'hidetoc' ) )
                                        .on( 'click keypress', function ( e ) {
                                                if (
@@ -58,4 +66,4 @@
                } );
        } );
 
-}( mediaWiki, jQuery ) );
+}() );