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-29 10:38:35 +0300
committerXhmikosR <xhmikosr@gmail.com>2022-01-29 14:25:30 +0300
commit62d86c07f81dfae632742dbf62633e767bac8edd (patch)
tree0632411740f52351da50f74a44b9a4ecb4d923c0 /js/src/util
parent3ac4451d47c41c3153d554eb7b84f558c137995e (diff)
Rename variables
Diffstat (limited to 'js/src/util')
-rw-r--r--js/src/util/sanitizer.js6
-rw-r--r--js/src/util/scrollbar.js24
2 files changed, 15 insertions, 15 deletions
diff --git a/js/src/util/sanitizer.js b/js/src/util/sanitizer.js
index 5a7a680355..1db61ae707 100644
--- a/js/src/util/sanitizer.js
+++ b/js/src/util/sanitizer.js
@@ -82,13 +82,13 @@ export const DefaultAllowlist = {
ul: []
}
-export function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
+export function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
if (!unsafeHtml.length) {
return unsafeHtml
}
- if (sanitizeFn && typeof sanitizeFn === 'function') {
- return sanitizeFn(unsafeHtml)
+ if (sanitizeFunction && typeof sanitizeFunction === 'function') {
+ return sanitizeFunction(unsafeHtml)
}
const domParser = new window.DOMParser()
diff --git a/js/src/util/scrollbar.js b/js/src/util/scrollbar.js
index b81d4b2372..86a2bca01f 100644
--- a/js/src/util/scrollbar.js
+++ b/js/src/util/scrollbar.js
@@ -61,39 +61,39 @@ class ScrollBarHelper {
this._element.style.overflow = 'hidden'
}
- _setElementAttributes(selector, styleProp, callback) {
+ _setElementAttributes(selector, styleProperty, callback) {
const scrollbarWidth = this.getWidth()
const manipulationCallBack = element => {
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
return
}
- this._saveInitialAttribute(element, styleProp)
- const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProp)
- element.style.setProperty(styleProp, `${callback(Number.parseFloat(calculatedValue))}px`)
+ this._saveInitialAttribute(element, styleProperty)
+ const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty)
+ element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`)
}
this._applyManipulationCallback(selector, manipulationCallBack)
}
- _saveInitialAttribute(element, styleProp) {
- const actualValue = element.style.getPropertyValue(styleProp)
+ _saveInitialAttribute(element, styleProperty) {
+ const actualValue = element.style.getPropertyValue(styleProperty)
if (actualValue) {
- Manipulator.setDataAttribute(element, styleProp, actualValue)
+ Manipulator.setDataAttribute(element, styleProperty, actualValue)
}
}
- _resetElementAttributes(selector, styleProp) {
+ _resetElementAttributes(selector, styleProperty) {
const manipulationCallBack = element => {
- const value = Manipulator.getDataAttribute(element, styleProp)
+ const value = Manipulator.getDataAttribute(element, styleProperty)
// We only want to remove the property if the value is `null`; the value can also be zero
if (value === null) {
- element.style.removeProperty(styleProp)
+ element.style.removeProperty(styleProperty)
return
}
- Manipulator.removeDataAttribute(element, styleProp)
- element.style.setProperty(styleProp, value)
+ Manipulator.removeDataAttribute(element, styleProperty)
+ element.style.setProperty(styleProperty, value)
}
this._applyManipulationCallback(selector, manipulationCallBack)