TOC: Avoid Sizzle selectors
[lhc/web/wiklou.git] / resources / src / mediawiki.toc / toc.js
index de81d6a..c1066f2 100644 (file)
 
                        // Hide/show the table of contents element
                        function toggleToc() {
-                               if ( $tocList.is( ':hidden' ) ) {
+                               if ( $this.hasClass( 'tochidden' ) ) {
+                                       // FIXME: Use CSS transitions
+                                       // eslint-disable-next-line no-jquery/no-slide
                                        $tocList.slideDown( 'fast' );
                                        $tocToggleLink.text( mw.msg( 'hidetoc' ) );
                                        $this.removeClass( 'tochidden' );
                                        mw.cookie.set( 'hidetoc', null );
                                } else {
+                                       // eslint-disable-next-line no-jquery/no-slide
                                        $tocList.slideUp( 'fast' );
                                        $tocToggleLink.text( mw.msg( 'showtoc' ) );
                                        $this.addClass( 'tochidden' );