mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-06 04:08:22 +01:00
there is no need for this.offsets and this.targets to be jQuery objects
This commit is contained in:
parent
2ca6581798
commit
0be4109688
@ -24,8 +24,8 @@
|
|||||||
this.selector = (this.options.target
|
this.selector = (this.options.target
|
||||||
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||||
|| '') + ' .nav li > a'
|
|| '') + ' .nav li > a'
|
||||||
this.offsets = $([])
|
this.offsets = []
|
||||||
this.targets = $([])
|
this.targets = []
|
||||||
this.activeTarget = null
|
this.activeTarget = null
|
||||||
|
|
||||||
this.refresh()
|
this.refresh()
|
||||||
@ -41,8 +41,9 @@
|
|||||||
ScrollSpy.prototype.refresh = function () {
|
ScrollSpy.prototype.refresh = function () {
|
||||||
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
|
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
|
||||||
|
|
||||||
this.offsets = $([])
|
this.offsets = []
|
||||||
this.targets = $([])
|
this.targets = []
|
||||||
|
|
||||||
var self = this
|
var self = this
|
||||||
|
|
||||||
this.$body
|
this.$body
|
||||||
@ -75,7 +76,7 @@
|
|||||||
var i
|
var i
|
||||||
|
|
||||||
if (scrollTop >= maxScroll) {
|
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]) {
|
if (activeTarget && scrollTop <= offsets[0]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user