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:
authorGeoSot <geo.sotis@gmail.com>2021-05-20 16:29:04 +0300
committerGitHub <noreply@github.com>2021-05-20 16:29:04 +0300
commit79c3bf47bc125fd64cf8cac6cd34b03270d34e2d (patch)
tree337b0109d9ad0b193abb8e9c80e7b804fd8817bd /js/src/util
parent9e4f87ae8f2e32bb31795ece8f9ab3e7b823dd7d (diff)
Add Tests on scrollbar.js & better handling if a style property doesn't exists (#33948)
* scrollbar.js: add some tests transfer test from modal.spec. to scrollbar.spec proper handling if style property doesn't exist
Diffstat (limited to 'js/src/util')
-rw-r--r--js/src/util/scrollbar.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/src/util/scrollbar.js b/js/src/util/scrollbar.js
index 98c076f25f..79a3b12c78 100644
--- a/js/src/util/scrollbar.js
+++ b/js/src/util/scrollbar.js
@@ -44,8 +44,11 @@ const _setElementAttributes = (selector, styleProp, callback) => {
}
const actualValue = element.style[styleProp]
+ if (actualValue) {
+ Manipulator.setDataAttribute(element, styleProp, actualValue)
+ }
+
const calculatedValue = window.getComputedStyle(element)[styleProp]
- Manipulator.setDataAttribute(element, styleProp, actualValue)
element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`
})
}