aboutsummaryrefslogtreecommitdiff
path: root/js/src/modal.js
diff options
context:
space:
mode:
authorGijs Boddeus <[email protected]>2017-09-13 16:46:14 +0200
committerGitHub <[email protected]>2017-09-13 16:46:14 +0200
commitcf004433e0312482a8c4918d559f38c19a3e14d9 (patch)
tree56fd67d5a60a1fe5442c969d29918db4f463b827 /js/src/modal.js
parent4356d08abb4d94785af15f3cc9be0e553f1c1c03 (diff)
parent75d435f76e48b19007495a02e79b0d41f2690361 (diff)
downloadbootstrap-cf004433e0312482a8c4918d559f38c19a3e14d9.tar.xz
bootstrap-cf004433e0312482a8c4918d559f38c19a3e14d9.zip
Merge pull request #4 from twbs/v4-dev
update forked v4-dev
Diffstat (limited to 'js/src/modal.js')
-rw-r--r--js/src/modal.js8
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()
}