// 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' );