aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Fenkart <[email protected]>2014-12-16 06:23:04 +0100
committerHeinrich Fenkart <[email protected]>2014-12-18 07:29:34 +0100
commit32f62bc565882b989fcef62874c0a90b0241dd1e (patch)
tree41490742178250a40c0ead0ff96e9d87c4eb5045
parent8deda6116f8f72b34ee46cd43c083aad7e13e406 (diff)
downloadbootstrap-32f62bc565882b989fcef62874c0a90b0241dd1e.tar.xz
bootstrap-32f62bc565882b989fcef62874c0a90b0241dd1e.zip
Modal: Work around IE scrollbars not taking up page width
Fixes #15353.
-rw-r--r--js/modal.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/modal.js b/js/modal.js
index 93891aa4e..6d68edc1f 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()
}