aboutsummaryrefslogtreecommitdiff
path: root/dist/js/bootstrap.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-11-25 17:40:44 -0800
committerMark Otto <[email protected]>2016-11-25 17:40:44 -0800
commitf2b98f6b2c52d6132524036bc327baee2eda3a48 (patch)
tree9176511da9761f3ec3c1a453953f04525dcf29c3 /dist/js/bootstrap.js
parentd328c911cbc74e6958ee747ebf17a7481a32d831 (diff)
downloadbootstrap-f2b98f6b2c52d6132524036bc327baee2eda3a48.tar.xz
bootstrap-f2b98f6b2c52d6132524036bc327baee2eda3a48.zip
grunt
Diffstat (limited to 'dist/js/bootstrap.js')
-rw-r--r--dist/js/bootstrap.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js
index 0ad3e6d7a..3778498fa 100644
--- a/dist/js/bootstrap.js
+++ b/dist/js/bootstrap.js
@@ -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]) {