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
diff options
context:
space:
mode:
authorRohit Sharma <rohit2sharma95@gmail.com>2021-03-30 08:57:05 +0300
committerGitHub <noreply@github.com>2021-03-30 08:57:05 +0300
commit5cc53a0ef0718b43e376462f156d39bf5542fbf9 (patch)
tree33c8c4d8643b15f8ad34ebb22c04814b1125f123 /js
parent8c3e6ebc6e3e4fe6e0c31470195704872ec125f7 (diff)
Use template literals instead of concatenation (#33497)
Diffstat (limited to 'js')
-rw-r--r--js/src/modal.js2
-rw-r--r--js/src/util/index.js6
-rw-r--r--js/src/util/scrollbar.js2
3 files changed, 4 insertions, 6 deletions
diff --git a/js/src/modal.js b/js/src/modal.js
index 2966f03fb5..4ce910dc6a 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -474,7 +474,7 @@ class Modal extends BaseComponent {
const actualValue = element.style[styleProp]
const calculatedValue = window.getComputedStyle(element)[styleProp]
Manipulator.setDataAttribute(element, styleProp, actualValue)
- element.style[styleProp] = callback(Number.parseFloat(calculatedValue)) + 'px'
+ element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`
})
}
diff --git a/js/src/util/index.js b/js/src/util/index.js
index a7578b1800..cc35d8a37c 100644
--- a/js/src/util/index.js
+++ b/js/src/util/index.js
@@ -48,7 +48,7 @@ const getSelector = element => {
// Just in case some CMS puts out a full URL with the anchor appended
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
- hrefAttr = '#' + hrefAttr.split('#')[1]
+ hrefAttr = `#${hrefAttr.split('#')[1]}`
}
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null
@@ -128,9 +128,7 @@ const typeCheckConfig = (componentName, config, configTypes) => {
if (!new RegExp(expectedTypes).test(valueType)) {
throw new TypeError(
- `${componentName.toUpperCase()}: ` +
- `Option "${property}" provided type "${valueType}" ` +
- `but expected type "${expectedTypes}".`
+ `${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`
)
}
})
diff --git a/js/src/util/scrollbar.js b/js/src/util/scrollbar.js
index 3e619ef51e..e63a66bf21 100644
--- a/js/src/util/scrollbar.js
+++ b/js/src/util/scrollbar.js
@@ -35,7 +35,7 @@ const _setElementAttributes = (selector, styleProp, callback) => {
const actualValue = element.style[styleProp]
const calculatedValue = window.getComputedStyle(element)[styleProp]
Manipulator.setDataAttribute(element, styleProp, actualValue)
- element.style[styleProp] = callback(Number.parseFloat(calculatedValue)) + 'px'
+ element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`
})
}