mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +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 isBodyOverflowing = scrollbarWidth > 0
|
||||
|
||||
if ((!isBodyOverflowing && isModalOverflowing && !isRTL()) || (isBodyOverflowing && !isModalOverflowing && isRTL())) {
|
||||
this._element.style.paddingLeft = `${scrollbarWidth}px`
|
||||
if (isBodyOverflowing && !isModalOverflowing) {
|
||||
const property = isRTL() ? 'paddingLeft' : 'paddingRight'
|
||||
this._element.style[property] = `${scrollbarWidth}px`
|
||||
}
|
||||
|
||||
if ((isBodyOverflowing && !isModalOverflowing && !isRTL()) || (!isBodyOverflowing && isModalOverflowing && isRTL())) {
|
||||
this._element.style.paddingRight = `${scrollbarWidth}px`
|
||||
if (!isBodyOverflowing && isModalOverflowing) {
|
||||
const property = isRTL() ? 'paddingRight' : 'paddingLeft'
|
||||
this._element.style[property] = `${scrollbarWidth}px`
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user