From 32f62bc565882b989fcef62874c0a90b0241dd1e Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Tue, 16 Dec 2014 06:23:04 +0100 Subject: [PATCH] Modal: Work around IE scrollbars not taking up page width Fixes #15353. --- js/modal.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() }