mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
simplify initialization on data-toggle
click
This commit is contained in:
parent
6f17e634ce
commit
e5b606d242
@ -322,12 +322,7 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
|
||||
const selectorElements = SelectorEngine.find(selector)
|
||||
|
||||
selectorElements.forEach(element => {
|
||||
const data = Collapse.getInstance(element)
|
||||
if (data) {
|
||||
data.toggle()
|
||||
} else {
|
||||
Collapse.getOrCreateInstance(element)
|
||||
}
|
||||
Collapse.getOrCreateInstance(element, { toggle: false }).toggle()
|
||||
})
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user