0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-29 21:52:22 +01:00

there is no need for this.offsets and this.targets to be jQuery objects

This commit is contained in:
Mike Greiling 2014-05-29 02:24:41 -05:00 committed by Chris Rebert
parent 2ca6581798
commit 0be4109688

View File

@ -24,8 +24,8 @@
this.selector = (this.options.target
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|| '') + ' .nav li > a'
this.offsets = $([])
this.targets = $([])
this.offsets = []
this.targets = []
this.activeTarget = null
this.refresh()
@ -41,8 +41,9 @@
ScrollSpy.prototype.refresh = function () {
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
this.offsets = $([])
this.targets = $([])
this.offsets = []
this.targets = []
var self = this
this.$body
@ -75,7 +76,7 @@
var i
if (scrollTop >= maxScroll) {
return activeTarget != (i = targets.last()[0]) && this.activate(i)
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
}
if (activeTarget && scrollTop <= offsets[0]) {