From: Heinrich Fenkart Date: Tue, 16 Dec 2014 05:23:04 +0000 (+0100) Subject: Modal: Work around IE scrollbars not taking up page width X-Git-Tag: v3.3.4~93^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32f62bc565882b989fcef62874c0a90b0241dd1e;p=thirdparty%2Fbootstrap.git Modal: Work around IE scrollbars not taking up page width Fixes #15353. --- diff --git a/js/modal.js b/js/modal.js index 93891aa4eb..6d68edc1f6 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() }