From: Derk-Jan Hartman Date: Tue, 8 May 2018 20:46:56 +0000 (+0200) Subject: makeCollapsible: fix state of nested collapsibles X-Git-Tag: 1.34.0-rc.0~5461 X-Git-Url: https://git.cyclocoop.org/admin/%7B%24admin_url%7Dmembres/import.php?a=commitdiff_plain;h=9114fbfdaea90a092c42b2530a6995a56449e69d;p=lhc%2Fweb%2Fwiklou.git makeCollapsible: fix state of nested collapsibles When collapsing or expanding an element which has nested other collapsibles, the labels of all nested toggles were updating to the value of the parent, while their state was not. Apply to the specific toggle only, just as the classes are applied to just the specific toggle. Bug: T168689 Change-Id: I1c3c29dc9ca4ccbf8da83796e56964a7a6d58a81 --- diff --git a/resources/src/jquery/jquery.makeCollapsible.js b/resources/src/jquery/jquery.makeCollapsible.js index e355196ed4..c3d7dbf2f1 100644 --- a/resources/src/jquery/jquery.makeCollapsible.js +++ b/resources/src/jquery/jquery.makeCollapsible.js @@ -190,7 +190,7 @@ collapseText = options.toggleText.collapseText; expandText = options.toggleText.expandText; - $textContainer = $collapsible.find( '.mw-collapsible-text' ); + $textContainer = $toggle.find( '.mw-collapsible-text' ); if ( $textContainer.length ) { $textContainer.text( wasCollapsed ? collapseText : expandText ); }