Patch from mybugs.mail
If a link is added inside of a collapsible toggle and a user click on it, the
target page should be opened.
…
The attached patch was tested locally and fixes this bug (clicking outside the
link toogles the collapsed content, and clicking on the link opens the target
page).
PS: It is the same code which was used to fix the problem on Commons.
http://commons.wikimedia.org/w/index.php?diff=
45383826&oldid=
45265712
* Mormegil
* MrPete
* MZMcBride
+* mybugs.mail
* Nakon
* Nathan Larson
* nephele
},
// Toggles collapsible and togglelink class
toggleLinkPremade = function( $that, e ) {
+ if ( $(e.target).is('a') ) {
+ return true;
+ }
var $collapsible = $that.eq(0).closest( '.mw-collapsible.mw-made-collapsible' ).toggleClass( 'mw-collapsed' );
e.preventDefault();
e.stopPropagation();