mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-20 12:21:35 +02:00
backdrop.js: cache _getElement
calls
This commit is contained in:
@@ -68,11 +68,12 @@ class Backdrop extends Config {
|
|||||||
|
|
||||||
this._append()
|
this._append()
|
||||||
|
|
||||||
|
const element = this._getElement()
|
||||||
if (this._config.isAnimated) {
|
if (this._config.isAnimated) {
|
||||||
reflow(this._getElement())
|
reflow(element)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._getElement().classList.add(CLASS_NAME_SHOW)
|
element.classList.add(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
this._emulateAnimation(() => {
|
this._emulateAnimation(() => {
|
||||||
execute(callback)
|
execute(callback)
|
||||||
@@ -130,9 +131,10 @@ class Backdrop extends Config {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this._config.rootElement.append(this._getElement())
|
const element = this._getElement()
|
||||||
|
this._config.rootElement.append(element)
|
||||||
|
|
||||||
EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
|
EventHandler.on(element, EVENT_MOUSEDOWN, () => {
|
||||||
execute(this._config.clickCallback)
|
execute(this._config.clickCallback)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user