2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-15 11:59:39 +03:00
This commit is contained in:
Mark Otto
2016-11-25 17:40:44 -08:00
parent d328c911cb
commit f2b98f6b2c
4 changed files with 16 additions and 6 deletions
+6 -1
View File
@@ -2307,10 +2307,14 @@ var ScrollSpy = function ($) {
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
};
ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() {
return this._scrollElement === window ? window.innerHeight : this._scrollElement.offsetHeight;
};
ScrollSpy.prototype._process = function _process() {
var scrollTop = this._getScrollTop() + this._config.offset;
var scrollHeight = this._getScrollHeight();
var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
if (this._scrollHeight !== scrollHeight) {
this.refresh();
@@ -2322,6 +2326,7 @@ var ScrollSpy = function ($) {
if (this._activeTarget !== target) {
this._activate(target);
}
return;
}
if (this._activeTarget && scrollTop < this._offsets[0]) {
+2 -2
View File
File diff suppressed because one or more lines are too long
+6 -1
View File
@@ -2307,10 +2307,14 @@ var ScrollSpy = function ($) {
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
};
ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() {
return this._scrollElement === window ? window.innerHeight : this._scrollElement.offsetHeight;
};
ScrollSpy.prototype._process = function _process() {
var scrollTop = this._getScrollTop() + this._config.offset;
var scrollHeight = this._getScrollHeight();
var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
if (this._scrollHeight !== scrollHeight) {
this.refresh();
@@ -2322,6 +2326,7 @@ var ScrollSpy = function ($) {
if (this._activeTarget !== target) {
this._activate(target);
}
return;
}
if (this._activeTarget && scrollTop < this._offsets[0]) {
+2 -2
View File
File diff suppressed because one or more lines are too long