mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
cache $(href) lookup
This commit is contained in:
parent
706ee46b73
commit
20e085723b
Binary file not shown.
7
docs/assets/js/bootstrap-scrollspy.js
vendored
7
docs/assets/js/bootstrap-scrollspy.js
vendored
@ -53,9 +53,10 @@
|
||||
.find(this.selector)
|
||||
.map(function () {
|
||||
var href = $(this).attr('href')
|
||||
return /^#\w/.test(href)
|
||||
&& $(href).length
|
||||
&& [[ $(href).position().top, href ]]
|
||||
, $href = /^#\w/.test(href) && $(href)
|
||||
return $href
|
||||
&& href.length
|
||||
&& [[ $href.position().top, href ]]
|
||||
})
|
||||
.sort(function (a, b) { return a[0] - b[0] })
|
||||
.each(function () {
|
||||
|
7
js/bootstrap-scrollspy.js
vendored
7
js/bootstrap-scrollspy.js
vendored
@ -53,9 +53,10 @@
|
||||
.find(this.selector)
|
||||
.map(function () {
|
||||
var href = $(this).attr('href')
|
||||
return /^#\w/.test(href)
|
||||
&& $(href).length
|
||||
&& [[ $(href).position().top, href ]]
|
||||
, $href = /^#\w/.test(href) && $(href)
|
||||
return $href
|
||||
&& href.length
|
||||
&& [[ $href.position().top, href ]]
|
||||
})
|
||||
.sort(function (a, b) { return a[0] - b[0] })
|
||||
.each(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user