mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
backdrop.js: cache _getElement
calls
This commit is contained in:
parent
0c3dfe104b
commit
3ac4451d47
1 changed files with 6 additions and 4 deletions
|
@ -68,11 +68,12 @@ class Backdrop extends Config {
|
|||
|
||||
this._append()
|
||||
|
||||
const element = this._getElement()
|
||||
if (this._config.isAnimated) {
|
||||
reflow(this._getElement())
|
||||
reflow(element)
|
||||
}
|
||||
|
||||
this._getElement().classList.add(CLASS_NAME_SHOW)
|
||||
element.classList.add(CLASS_NAME_SHOW)
|
||||
|
||||
this._emulateAnimation(() => {
|
||||
execute(callback)
|
||||
|
@ -130,9 +131,10 @@ class Backdrop extends Config {
|
|||
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)
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue