aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2012-03-19 15:18:00 -0700
committerJacob Thornton <[email protected]>2012-03-19 15:18:00 -0700
commit5a2c7eb50abae8d07cebb6b0e984f7e63843cf75 (patch)
treece10bed5cf73666443189b0e0ad3aba72640bc4c /docs
parent527fb87dadd1e677f132ca3db0b02825d5bd57e5 (diff)
downloadbootstrap-5a2c7eb50abae8d07cebb6b0e984f7e63843cf75.tar.xz
bootstrap-5a2c7eb50abae8d07cebb6b0e984f7e63843cf75.zip
select last item in scrollspy if you've reached the bottom of the document or element
Diffstat (limited to 'docs')
-rw-r--r--docs/assets/bootstrap.zipbin55602 -> 55705 bytes
-rw-r--r--docs/assets/js/bootstrap-scrollspy.js7
2 files changed, 7 insertions, 0 deletions
diff --git a/docs/assets/bootstrap.zip b/docs/assets/bootstrap.zip
index 7f099d78f..62bfbb267 100644
--- a/docs/assets/bootstrap.zip
+++ b/docs/assets/bootstrap.zip
Binary files differ
diff --git a/docs/assets/js/bootstrap-scrollspy.js b/docs/assets/js/bootstrap-scrollspy.js
index ea29f2f86..47b485785 100644
--- a/docs/assets/js/bootstrap-scrollspy.js
+++ b/docs/assets/js/bootstrap-scrollspy.js
@@ -57,11 +57,18 @@
, process: function () {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
+ , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
+ , maxScroll = scrollHeight - this.$scrollElement.height()
, offsets = this.offsets
, targets = this.targets
, activeTarget = this.activeTarget
, i
+ if (scrollTop >= maxScroll) {
+ return activeTarget != (i = targets.last()[0])
+ && this.activate ( i );
+ }
+
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]