mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-15 11:59:39 +03:00
Change adjustDialog's if conditions to improve readability
This commit is contained in:
+6
-4
@@ -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`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user