aboutsummaryrefslogtreecommitdiff
path: root/js/src/collapse.js
diff options
context:
space:
mode:
authorMartijn Cuppens <[email protected]>2017-12-31 13:53:33 +0100
committerXhmikosR <[email protected]>2017-12-31 14:53:33 +0200
commitae71e71fe1fa3bdbdec33c9eb19b76c346d4d5ff (patch)
treedcef53781b4d6cdea9ad679f0779d7068997e18c /js/src/collapse.js
parentbee859cc9c5217ee738f9d5b0183b381d2ccbff4 (diff)
downloadbootstrap-ae71e71fe1fa3bdbdec33c9eb19b76c346d4d5ff.tar.xz
bootstrap-ae71e71fe1fa3bdbdec33c9eb19b76c346d4d5ff.zip
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.
Diffstat (limited to 'js/src/collapse.js')
-rw-r--r--js/src/collapse.js6
1 files changed, 5 insertions, 1 deletions
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
}