From d3a27168aaba8cbc83fe2378126d0681d59715ce Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Fri, 29 Dec 2017 18:17:13 +0100 Subject: [PATCH 1/4] Allow nested structure for accordions --- js/src/collapse.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/collapse.js b/js/src/collapse.js index f4d140f272b5..eaad1be5412d 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 } From 61473bf243a3622cf52eff5a85ea29b3c11541af Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Sat, 30 Dec 2017 22:14:03 +0100 Subject: [PATCH 2/4] Allow nested structure for accordions 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. --- docs/4.0/components/collapse.md | 29 +---------------------------- js/tests/unit/collapse.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 38 deletions(-) diff --git a/docs/4.0/components/collapse.md b/docs/4.0/components/collapse.md index e2ab5a01ace6..4d81cf1ec197 100644 --- a/docs/4.0/components/collapse.md +++ b/docs/4.0/components/collapse.md @@ -63,7 +63,7 @@ Multiple `