mirror of
https://github.com/twbs/bootstrap.git
synced 2024-11-29 11:24:18 +01:00
Use template literals instead of concatenation (#33497)
This commit is contained in:
parent
8c3e6ebc6e
commit
5cc53a0ef0
@ -474,7 +474,7 @@ class Modal extends BaseComponent {
|
|||||||
const actualValue = element.style[styleProp]
|
const actualValue = element.style[styleProp]
|
||||||
const calculatedValue = window.getComputedStyle(element)[styleProp]
|
const calculatedValue = window.getComputedStyle(element)[styleProp]
|
||||||
Manipulator.setDataAttribute(element, styleProp, actualValue)
|
Manipulator.setDataAttribute(element, styleProp, actualValue)
|
||||||
element.style[styleProp] = callback(Number.parseFloat(calculatedValue)) + 'px'
|
element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ const getSelector = element => {
|
|||||||
|
|
||||||
// Just in case some CMS puts out a full URL with the anchor appended
|
// Just in case some CMS puts out a full URL with the anchor appended
|
||||||
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
|
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
|
||||||
hrefAttr = '#' + hrefAttr.split('#')[1]
|
hrefAttr = `#${hrefAttr.split('#')[1]}`
|
||||||
}
|
}
|
||||||
|
|
||||||
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null
|
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null
|
||||||
@ -128,9 +128,7 @@ const typeCheckConfig = (componentName, config, configTypes) => {
|
|||||||
|
|
||||||
if (!new RegExp(expectedTypes).test(valueType)) {
|
if (!new RegExp(expectedTypes).test(valueType)) {
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
`${componentName.toUpperCase()}: ` +
|
`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`
|
||||||
`Option "${property}" provided type "${valueType}" ` +
|
|
||||||
`but expected type "${expectedTypes}".`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -35,7 +35,7 @@ const _setElementAttributes = (selector, styleProp, callback) => {
|
|||||||
const actualValue = element.style[styleProp]
|
const actualValue = element.style[styleProp]
|
||||||
const calculatedValue = window.getComputedStyle(element)[styleProp]
|
const calculatedValue = window.getComputedStyle(element)[styleProp]
|
||||||
Manipulator.setDataAttribute(element, styleProp, actualValue)
|
Manipulator.setDataAttribute(element, styleProp, actualValue)
|
||||||
element.style[styleProp] = callback(Number.parseFloat(calculatedValue)) + 'px'
|
element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user