Merge "Test ApiUserrights"
[lhc/web/wiklou.git] / resources / src / jquery / jquery.makeCollapsible.js
index 9d3df8c..7826bab 100644 (file)
@@ -8,7 +8,6 @@
  * @class jQuery.plugin.makeCollapsible
  */
 ( function ( $, mw ) {
-
        /**
         * Handler for a click on a collapsible toggler.
         *
                if ( e ) {
                        if (
                                e.type === 'click' &&
-                               e.target.nodeName.toLowerCase() === 'a'
+                               e.target.nodeName.toLowerCase() === 'a' &&
+                               $( e.target ).attr( 'href' )
                        ) {
                                // Don't fire if a link was clicked (for premade togglers)
                                return;
 
                        // Default toggle link. Only build it when needed to avoid jQuery memory leaks (event data).
                        buildDefaultToggleLink = function () {
-                               return $( '<span class="mw-collapsible-text"></span>' )
+                               return $( '<a class="mw-collapsible-text"></a>' )
                                        .text( collapseText )
-                                       .wrap( '<span class="mw-collapsible-toggle"></span>' ).parent()
-                                               .attr( {
-                                                       role: 'button',
-                                                       tabindex: 0
-                                               } )
-                                               .prepend( '<span>[</span>' )
-                                               .append( '<span>]</span>' )
-                                               .on( 'click.mw-collapsible keypress.mw-collapsible', actionHandler );
+                                       .wrap( '<span class="mw-collapsible-toggle"></span>' )
+                                       .parent()
+                                       .attr( {
+                                               role: 'button',
+                                               tabindex: 0
+                                       } )
+                                       .on( 'click.mw-collapsible keypress.mw-collapsible', actionHandler );
                        };
 
                        // Check if this element has a custom position for the toggle link