1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-27 05:49:07 +02:00

Rename variables

This commit is contained in:
XhmikosR
2021-10-29 10:38:35 +03:00
parent 3ac4451d47
commit 62d86c07f8
15 changed files with 115 additions and 115 deletions

View File

@@ -70,7 +70,7 @@ class Collapse extends BaseComponent {
for (const elem of toggleList) {
const selector = getSelectorFromElement(elem)
const filterElement = SelectorEngine.find(selector)
.filter(foundElem => foundElem === this._element)
.filter(foundElement => foundElement === this._element)
if (selector !== null && filterElement.length) {
this._triggerArray.push(elem)
@@ -185,9 +185,9 @@ class Collapse extends BaseComponent {
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)
for (const trigger of this._triggerArray) {
const elem = getElementFromSelector(trigger)
const element = getElementFromSelector(trigger)
if (elem && !this._isShown(elem)) {
if (element && !this._isShown(element)) {
this._addAriaAndCollapsedClass([trigger], false)
}
}
@@ -240,7 +240,7 @@ class Collapse extends BaseComponent {
_getFirstLevelChildren(selector) {
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)
// remove children if greater depth
return SelectorEngine.find(selector, this._config.parent).filter(elem => !children.includes(elem))
return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element))
}
_addAriaAndCollapsedClass(triggerArray, isOpen) {
@@ -248,14 +248,14 @@ class Collapse extends BaseComponent {
return
}
for (const elem of triggerArray) {
for (const element of triggerArray) {
if (isOpen) {
elem.classList.remove(CLASS_NAME_COLLAPSED)
element.classList.remove(CLASS_NAME_COLLAPSED)
} else {
elem.classList.add(CLASS_NAME_COLLAPSED)
element.classList.add(CLASS_NAME_COLLAPSED)
}
elem.setAttribute('aria-expanded', isOpen)
element.setAttribute('aria-expanded', isOpen)
}
}