mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
Merge pull request #15378 from twbs/fix-ie-modal-scrollbar-for-realz
Modal: Work around IE scrollbars not taking up page width
This commit is contained in:
commit
16479e9051
@ -248,7 +248,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Modal.prototype.checkScrollbar = function () {
|
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()
|
this.scrollbarWidth = this.measureScrollbar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user