diff options
| author | Heinrich Fenkart <[email protected]> | 2014-12-16 06:23:04 +0100 |
|---|---|---|
| committer | Heinrich Fenkart <[email protected]> | 2014-12-18 07:29:34 +0100 |
| commit | 32f62bc565882b989fcef62874c0a90b0241dd1e (patch) | |
| tree | 41490742178250a40c0ead0ff96e9d87c4eb5045 /js | |
| parent | 8deda6116f8f72b34ee46cd43c083aad7e13e406 (diff) | |
| download | bootstrap-32f62bc565882b989fcef62874c0a90b0241dd1e.tar.xz bootstrap-32f62bc565882b989fcef62874c0a90b0241dd1e.zip | |
Modal: Work around IE scrollbars not taking up page width
Fixes #15353.
Diffstat (limited to 'js')
| -rw-r--r-- | js/modal.js | 7 |
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() } |
