Fixing issue with multiple premade toggles in a non-custom collapsible element.
authorKrinkle <krinkle@users.mediawiki.org>
Fri, 11 Feb 2011 22:30:14 +0000 (22:30 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Fri, 11 Feb 2011 22:30:14 +0000 (22:30 +0000)
commit2e6b0c5fa1d58fa4afaea80269d56ce2640f5df5
treeeaf5d30883d2dbd72bd926bb9ca613b028689f6f
parenta59446dd48856fedbbe6f1d368793c2c7278de3f
Fixing issue with multiple premade toggles in a non-custom collapsible element.
The problem is that when one of the toggles is clicked the classname is only changed on the toggle that was clicked. The others will stil have the wrong class. On of the areas in which this may lead to weird behaviour is the :hover styles for the up- and downarrow cursors.

Previously would bind to all of them :

<pre>
 = .find( '> .mw-collapsible-toggle' );
// ^ may match multiple ones
</pre>

...  which is good. But in the click handler:

<pre>
[..].bind( 'click.mw-collapse', function( e ){
toggleLinkPremade( this, e );
} );
</pre>

... only called the function with 'this'. This has been changed to pass all of  instead.

This problem was discovered in the following scenario. Where an .mw-collapsible has three children. The first two are clickable and are the togglers for the third child.
http://translatewiki.net/w/i.php?title=Sandbox&oldid=2692006
resources/jquery/jquery.makeCollapsible.js