mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-30 22:52:24 +01:00
Change adjustDialog's if conditions to improve readability
This commit is contained in:
parent
569bca54d2
commit
91ad255e07
@ -326,12 +326,14 @@ class Modal extends BaseComponent {
|
|||||||
const scrollbarWidth = this._scrollBar.getWidth()
|
const scrollbarWidth = this._scrollBar.getWidth()
|
||||||
const isBodyOverflowing = scrollbarWidth > 0
|
const isBodyOverflowing = scrollbarWidth > 0
|
||||||
|
|
||||||
if ((!isBodyOverflowing && isModalOverflowing && !isRTL()) || (isBodyOverflowing && !isModalOverflowing && isRTL())) {
|
if (isBodyOverflowing && !isModalOverflowing) {
|
||||||
this._element.style.paddingLeft = `${scrollbarWidth}px`
|
const property = isRTL() ? 'paddingLeft' : 'paddingRight'
|
||||||
|
this._element.style[property] = `${scrollbarWidth}px`
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((isBodyOverflowing && !isModalOverflowing && !isRTL()) || (!isBodyOverflowing && isModalOverflowing && isRTL())) {
|
if (!isBodyOverflowing && isModalOverflowing) {
|
||||||
this._element.style.paddingRight = `${scrollbarWidth}px`
|
const property = isRTL() ? 'paddingRight' : 'paddingLeft'
|
||||||
|
this._element.style[property] = `${scrollbarWidth}px`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user