mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 02:24:19 +02:00
dist
This commit is contained in:
16
js/dist/collapse.js
vendored
16
js/dist/collapse.js
vendored
@@ -171,7 +171,11 @@
|
||||
|
||||
if (this._parent) {
|
||||
actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) {
|
||||
return elem.getAttribute('data-parent') === _this._config.parent;
|
||||
if (typeof _this._config.parent === 'string') {
|
||||
return elem.getAttribute('data-parent') === _this._config.parent;
|
||||
}
|
||||
|
||||
return elem.classList.contains(ClassName.COLLAPSE);
|
||||
});
|
||||
|
||||
if (actives.length === 0) {
|
||||
@@ -308,7 +312,7 @@
|
||||
_proto._getParent = function _getParent() {
|
||||
var _this3 = this;
|
||||
|
||||
var parent = null;
|
||||
var parent;
|
||||
|
||||
if (Util.isElement(this._config.parent)) {
|
||||
parent = this._config.parent; // It's a jQuery object
|
||||
@@ -329,12 +333,10 @@
|
||||
};
|
||||
|
||||
_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
|
||||
if (element) {
|
||||
var isOpen = $$$1(element).hasClass(ClassName.SHOW);
|
||||
var isOpen = $$$1(element).hasClass(ClassName.SHOW);
|
||||
|
||||
if (triggerArray.length) {
|
||||
$$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
||||
}
|
||||
if (triggerArray.length) {
|
||||
$$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
||||
}
|
||||
}; // Static
|
||||
|
||||
|
Reference in New Issue
Block a user