From 9cbcb3be0ce96f813dfc408492ad6b8b57f4a980 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Thu, 16 Jun 2011 22:27:22 +0000 Subject: [PATCH] =?utf8?q?Fix=20Bug=20#28344=20-=20=E2=80=9CLinks=20doesn'?= =?utf8?q?t=20work=20inside=20collapsible=20toggles=E2=80=9D=20Patch=20fro?= =?utf8?q?m=20mybugs.mail?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- CREDITS | 1 + resources/jquery/jquery.makeCollapsible.js | 3 +++ 2 files changed, 4 insertions(+) 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(); -- 2.20.1