Commit 162d9e17 authored by fat's avatar fat

Merge branch 'scrollspy-speedy-scroll-top' of...

Merge branch 'scrollspy-speedy-scroll-top' of git://github.com/ziogaschr/bootstrap into ziogaschr-scrollspy-speedy-scroll-top

Conflicts:
	dist/js/bootstrap.min.js
parents 9d73d9c3 ed5dbf1b
...@@ -1572,6 +1572,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -1572,6 +1572,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
return ($href return ($href
&& $href.length && $href.length
&& $href.is(':visible')
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
}) })
.sort(function (a, b) { return a[0] - b[0] }) .sort(function (a, b) { return a[0] - b[0] })
...@@ -1594,6 +1595,11 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -1594,6 +1595,11 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
return activeTarget != (i = targets.last()[0]) && this.activate(i) return activeTarget != (i = targets.last()[0]) && this.activate(i)
} }
if (activeTarget && scrollTop <= offsets[0]) {
debugger
return activeTarget != (i = targets.first()[0]) && this.activate(i)
}
for (i = offsets.length; i--;) { for (i = offsets.length; i--;) {
activeTarget != targets[i] activeTarget != targets[i]
&& scrollTop >= offsets[i] && scrollTop >= offsets[i]
......
This diff is collapsed.
...@@ -74,6 +74,10 @@ ...@@ -74,6 +74,10 @@
return activeTarget != (i = targets.last()[0]) && this.activate(i) return activeTarget != (i = targets.last()[0]) && this.activate(i)
} }
if (activeTarget && scrollTop <= offsets[0]) {
return activeTarget != (i = targets[0]) && this.activate(i)
}
for (i = offsets.length; i--;) { for (i = offsets.length; i--;) {
activeTarget != targets[i] activeTarget != targets[i]
&& scrollTop >= offsets[i] && scrollTop >= offsets[i]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment