mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-05-09 21:04:42 +00:00
Change adjustDialog's if conditions to improve readability
This commit is contained in:
parent
569bca54d2
commit
91ad255e07
1 changed files with 6 additions and 4 deletions
|
|
@ -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…
Reference in a new issue