diff options
author | Johann-S <johann.servoire@gmail.com> | 2017-05-16 10:59:44 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2017-05-16 11:09:48 +0300 |
commit | 3719ed4cb69fd8c75869158b086b4fc077e63e14 (patch) | |
tree | 20c4aa1021aacd824b752d5ab85377ac782b4d90 /js/dist/collapse.js | |
parent | 183205afb87582bf905e1fac0b6c5353c0b2d28c (diff) |
build
Diffstat (limited to 'js/dist/collapse.js')
-rw-r--r-- | js/dist/collapse.js | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/js/dist/collapse.js b/js/dist/collapse.js index d5105f4421..0e2bc75e21 100644 --- a/js/dist/collapse.js +++ b/js/dist/collapse.js @@ -58,9 +58,8 @@ var Collapse = function ($) { }; var Selector = { - ACTIVES: '.card > .show, .card > .collapsing', - DATA_TOGGLE: '[data-toggle="collapse"]', - DATA_CHILDREN: 'data-children' + ACTIVES: '.show, .collapsing', + DATA_TOGGLE: '[data-toggle="collapse"]' }; /** @@ -77,20 +76,13 @@ var Collapse = function ($) { this._element = element; this._config = this._getConfig(config); this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]'))); + this._parent = this._config.parent ? this._getParent() : null; if (!this._config.parent) { this._addAriaAndCollapsedClass(this._element, this._triggerArray); } - this._selectorActives = Selector.ACTIVES; - if (this._parent) { - var childrenSelector = this._parent.hasAttribute(Selector.DATA_CHILDREN) ? this._parent.getAttribute(Selector.DATA_CHILDREN) : null; - if (childrenSelector !== null) { - this._selectorActives = childrenSelector + ' > .show, ' + childrenSelector + ' > .collapsing'; - } - } - if (this._config.toggle) { this.toggle(); } @@ -119,7 +111,7 @@ var Collapse = function ($) { var activesData = void 0; if (this._parent) { - actives = $.makeArray($(this._parent).find(this._selectorActives)); + actives = $.makeArray($(this._parent).children().children(Selector.ACTIVES)); if (!actives.length) { actives = null; } |