From: Krinkle Date: Fri, 24 Dec 2010 15:24:28 +0000 (+0000) Subject: Forgot to namespace the click handler. Unbinding all click handlers is indeed risky... X-Git-Tag: 1.31.0-rc.0~33109 X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=commitdiff_plain;h=ed5d9a08b0de69fb7f164b5edcb65b974cd772b3;p=lhc%2Fweb%2Fwiklou.git Forgot to namespace the click handler. Unbinding all click handlers is indeed risky (Follow-up r78935 CR) --- diff --git a/resources/jquery/jquery.makeCollapsible.js b/resources/jquery/jquery.makeCollapsible.js index 43a7f8b0ef..0b4b85de5c 100644 --- a/resources/jquery/jquery.makeCollapsible.js +++ b/resources/jquery/jquery.makeCollapsible.js @@ -83,7 +83,7 @@ $.fn.makeCollapsible = function() { } // Create toggle link with a space around the brackets ( [text] ) - var $toggleLink = $( '' ).text( collapsetext ).wrap( '' ).parent().prepend( ' [' ).append( '] ' ).click( function(e){ + var $toggleLink = $( '' ).text( collapsetext ).wrap( '' ).parent().prepend( ' [' ).append( '] ' ).bind( 'click.mw-collapse', function(e){ e.preventDefault(); toggleFunction( this ); } ); @@ -104,7 +104,7 @@ $.fn.makeCollapsible = function() { if ( !$toggle.size() ) { $lastCell.prepend( $toggleLink ); } else { - $toggleLink = $toggle.unbind( 'click' ).click( function( e ){ + $toggleLink = $toggle.unbind( 'click.mw-collapse' ).bind( 'click.mw-collapse', function( e ){ e.preventDefault(); toggleFunction( this ); } ); @@ -122,7 +122,7 @@ $.fn.makeCollapsible = function() { } $that.prepend( $toggleLink.wrap( '
  • ' ).parent() ); } else { - $toggleLink = $toggle.unbind( 'click' ).click( function( e ){ + $toggleLink = $toggle.unbind( 'click.mw-collapse' ).bind( 'click.mw-collapse', function( e ){ e.preventDefault(); toggleFunction( this ); } ); @@ -141,7 +141,7 @@ $.fn.makeCollapsible = function() { if ( !$toggle.size() ) { $that.prepend( $toggleLink ); } else { - $toggleLink = $toggle.unbind( 'click' ).click( function( e ){ + $toggleLink = $toggle.unbind( 'click.mw-collapse' ).bind( 'click.mw-collapse', function( e ){ e.preventDefault(); toggleFunction( this ); } );