Skip to content

Commit 8c678e9

Browse files
committed
Merge pull request #19775 from twbs/modal-ie8-innerWidth
Modal: Remove IE8-specific window.innerWidth workaround
2 parents 06b127a + afdd62d commit 8c678e9

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

js/src/modal.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,7 @@ const Modal = (($) => {
408408
}
409409

410410
_checkScrollbar() {
411-
let fullWindowWidth = window.innerWidth
412-
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
413-
let documentElementRect = document.documentElement.getBoundingClientRect()
414-
fullWindowWidth =
415-
documentElementRect.right - Math.abs(documentElementRect.left)
416-
}
417-
this._isBodyOverflowing = document.body.clientWidth < fullWindowWidth
411+
this._isBodyOverflowing = document.body.clientWidth < window.innerWidth
418412
this._scrollbarWidth = this._getScrollbarWidth()
419413
}
420414

0 commit comments

Comments
 (0)