aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHeinrich Fenkart <[email protected]>2015-02-24 03:33:32 +0100
committerHeinrich Fenkart <[email protected]>2015-02-24 03:33:32 +0100
commit16479e9051614696df3d21acd9d482018da17045 (patch)
tree7ed83bd86bf19b684ff5a684e6e5799bc74ce161 /js
parent68fef8c2470be258107f5ab0d587c89ebfaaa221 (diff)
parent32f62bc565882b989fcef62874c0a90b0241dd1e (diff)
downloadbootstrap-16479e9051614696df3d21acd9d482018da17045.tar.xz
bootstrap-16479e9051614696df3d21acd9d482018da17045.zip
Merge pull request #15378 from twbs/fix-ie-modal-scrollbar-for-realz
Modal: Work around IE scrollbars not taking up page width
Diffstat (limited to 'js')
-rw-r--r--js/modal.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/modal.js b/js/modal.js
index e7704b8fc..c45437dfb 100644
--- a/js/modal.js
+++ b/js/modal.js
@@ -248,7 +248,12 @@
}
Modal.prototype.checkScrollbar = function () {
- this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
+ var fullWindowWidth = window.innerWidth
+ if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
+ var documentElementRect = document.documentElement.getBoundingClientRect()
+ fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
+ }
+ this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
this.scrollbarWidth = this.measureScrollbar()
}