// 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 (