Merge "Remove last remnants of pre-1.16 live preview"
[lhc/web/wiklou.git] / resources / src / jquery / jquery.makeCollapsible.js
index 1edb9f2..eef3846 100644 (file)
                        };
                        // Default toggle link. Only build it when needed to avoid jQuery memory leaks (event data).
                        buildDefaultToggleLink = function () {
-                               return $( '<a href="#"></a>' )
+                               return $( '<a>' )
+                                       .attr( {
+                                               role: 'button',
+                                               tabindex: 0
+                                       } )
                                        .text( collapseText )
                                        .wrap( '<span class="mw-collapsible-toggle"></span>' )
                                                .parent()
                                        }
 
                                } else if ( $collapsible.parent().is( 'li' ) &&
-                                       $collapsible.parent().children( '.mw-collapsible' ).size() === 1 &&
-                                       $collapsible.find( '> .mw-collapsible-toggle' ).size() === 0
+                                       $collapsible.parent().children( '.mw-collapsible' ).length === 1 &&
+                                       $collapsible.find( '> .mw-collapsible-toggle' ).length === 0
                                ) {
                                        // special case of one collapsible in <li> tag
                                        $toggleLink = buildDefaultToggleLink();