diff options
Diffstat (limited to 'js/src/modal.js')
| -rw-r--r-- | js/src/modal.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/src/modal.js b/js/src/modal.js index ab73230c8..689e93bc1 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -1,3 +1,4 @@ +import $ from 'jquery' import Util from './util' @@ -8,7 +9,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Modal = (($) => { +const Modal = (() => { /** @@ -135,6 +136,8 @@ const Modal = (($) => { this._checkScrollbar() this._setScrollbar() + this._adjustDialog() + $(document.body).addClass(ClassName.OPEN) this._setEscapeEvent() @@ -426,7 +429,8 @@ const Modal = (($) => { } _checkScrollbar() { - this._isBodyOverflowing = document.body.clientWidth < window.innerWidth + const rect = document.body.getBoundingClientRect() + this._isBodyOverflowing = rect.left + rect.right < window.innerWidth this._scrollbarWidth = this._getScrollbarWidth() } |
