grunt
This commit is contained in:
parent
275821bbb0
commit
ae50bb7845
|
@ -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;
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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() {
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue