Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src/util
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2021-10-09 21:50:21 +0300
committerXhmikosR <xhmikosr@gmail.com>2022-01-29 14:25:30 +0300
commit3ac4451d47c41c3153d554eb7b84f558c137995e (patch)
treebbe0f2b05333ae98283f38e8b2951d160a893f93 /js/src/util
parent0c3dfe104b520d6ce466f265bf60c6d74785972e (diff)
backdrop.js: cache `_getElement` calls
Diffstat (limited to 'js/src/util')
-rw-r--r--js/src/util/backdrop.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/src/util/backdrop.js b/js/src/util/backdrop.js
index 63f2b581c6..8f121e5bd2 100644
--- a/js/src/util/backdrop.js
+++ b/js/src/util/backdrop.js
@@ -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)
})