aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2021-06-10 01:10:14 +0300
committerXhmikosR <[email protected]>2021-07-29 16:30:02 +0300
commit4961ad0c63849d360edf7c23a15001ff56d58639 (patch)
tree8c6c0f25fa396b9285b4290b5dcb3440fc17dc0e /js
parent2ad0a4a9fdbc792502c6800f6ae68c41acf4b556 (diff)
downloadbootstrap-4961ad0c63849d360edf7c23a15001ff56d58639.tar.xz
bootstrap-4961ad0c63849d360edf7c23a15001ff56d58639.zip
Remove redundant check on `data-toggle` click.
Previously, it was assumed that the trigger element would have its own separate config than the collapse element itself.
Diffstat (limited to 'js')
-rw-r--r--js/src/collapse.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/js/src/collapse.js b/js/src/collapse.js
index a8651fc0a..fcb8be6d7 100644
--- a/js/src/collapse.js
+++ b/js/src/collapse.js
@@ -347,26 +347,16 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
event.preventDefault()
}
- const triggerData = Manipulator.getDataAttributes(this)
const selector = getSelectorFromElement(this)
const selectorElements = SelectorEngine.find(selector)
selectorElements.forEach(element => {
const data = Collapse.getInstance(element)
- let config
if (data) {
- // update parent attribute
- if (data._parent === null && typeof triggerData.parent === 'string') {
- data._config.parent = triggerData.parent
- data._parent = data._getParent()
- }
-
- config = 'toggle'
+ data.toggle()
} else {
- config = triggerData
+ Collapse.getOrCreateInstance(element)
}
-
- Collapse.collapseInterface(element, config)
})
})