From ae71e71fe1fa3bdbdec33c9eb19b76c346d4d5ff Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Sun, 31 Dec 2017 13:53:33 +0100 Subject: Allow nested structure for accordions (#25121) This commit allows nested structures for accordions. Also a part of the documentation about data-children is removed because this functionality didn't work and it's not applicable anymore. Tests with the collapse accordion are also a bit adjusted to the new situation. --- js/src/collapse.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js/src') diff --git a/js/src/collapse.js b/js/src/collapse.js index f4d140f27..eaad1be54 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -130,7 +130,11 @@ const Collapse = (($) => { let activesData if (this._parent) { - actives = $.makeArray($(this._parent).children().children(Selector.ACTIVES)) + actives = $.makeArray( + $(this._parent) + .find(Selector.ACTIVES) + .filter(`[data-parent="${this._config.parent}"]`) + ) if (!actives.length) { actives = null } -- cgit v1.2.3