diff --git a/js/dist/modal.js b/js/dist/modal.js index 73d203eda..8138f1949 100644 --- a/js/dist/modal.js +++ b/js/dist/modal.js @@ -436,7 +436,7 @@ var Modal = function ($) { var scrollDiv = document.createElement('div'); scrollDiv.className = ClassName.SCROLLBAR_MEASURER; document.body.appendChild(scrollDiv); - var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; + var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); return scrollbarWidth; }; diff --git a/js/dist/modal.js.map b/js/dist/modal.js.map index d4b739b0d..9a34bd6a3 100644 Binary files a/js/dist/modal.js.map and b/js/dist/modal.js.map differ diff --git a/js/dist/scrollspy.js b/js/dist/scrollspy.js index 52cf3de3b..10fc3c394 100644 --- a/js/dist/scrollspy.js +++ b/js/dist/scrollspy.js @@ -126,9 +126,12 @@ var ScrollSpy = function ($) { target = $(targetSelector)[0]; } - if (target && (target.offsetWidth || target.offsetHeight)) { - // todo (fat): remove sketch reliance on jQuery position/offset - return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; + if (target) { + var targetBCR = target.getBoundingClientRect(); + if (targetBCR.width || targetBCR.height) { + // todo (fat): remove sketch reliance on jQuery position/offset + return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; + } } return null; }).filter(function (item) { @@ -183,7 +186,7 @@ var ScrollSpy = function ($) { }; ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() { - return this._scrollElement === window ? window.innerHeight : this._scrollElement.offsetHeight; + return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; }; ScrollSpy.prototype._process = function _process() { diff --git a/js/dist/scrollspy.js.map b/js/dist/scrollspy.js.map index d02dc8993..132a26718 100644 Binary files a/js/dist/scrollspy.js.map and b/js/dist/scrollspy.js.map differ