From: Mark A. Hershberger Date: Thu, 16 Jun 2011 22:27:22 +0000 (+0000) Subject: Fix Bug #28344 - “Links doesn't work inside collapsible toggles” X-Git-Tag: 1.31.0-rc.0~29485 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=9cbcb3be0ce96f813dfc408492ad6b8b57f4a980;p=lhc%2Fweb%2Fwiklou.git Fix Bug #28344 - “Links doesn't work inside collapsible toggles” 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 --- diff --git a/CREDITS b/CREDITS index bf4f29e2ca..8a6e199704 100644 --- a/CREDITS +++ b/CREDITS @@ -125,6 +125,7 @@ following names for their contribution to the product. * Mormegil * MrPete * MZMcBride +* mybugs.mail * Nakon * Nathan Larson * nephele diff --git a/resources/jquery/jquery.makeCollapsible.js b/resources/jquery/jquery.makeCollapsible.js index d708afe40c..445213ebe4 100644 --- a/resources/jquery/jquery.makeCollapsible.js +++ b/resources/jquery/jquery.makeCollapsible.js @@ -176,6 +176,9 @@ $.fn.makeCollapsible = function() { }, // 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();