From 9114fbfdaea90a092c42b2530a6995a56449e69d Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Tue, 8 May 2018 22:46:56 +0200 Subject: [PATCH] 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 --- resources/src/jquery/jquery.makeCollapsible.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ); } -- 2.20.1