1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

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

Conflicts:
	dist/js/bootstrap.min.js
This commit is contained in:
fat 2013-12-29 18:04:43 -08:00
commit 162d9e1776
3 changed files with 11 additions and 1 deletions

View file

@ -1572,6 +1572,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
return ($href
&& $href.length
&& $href.is(':visible')
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
})
.sort(function (a, b) { return a[0] - b[0] })
@ -1594,6 +1595,11 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
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--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]

File diff suppressed because one or more lines are too long

View file

@ -74,6 +74,10 @@
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--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]