0
0
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:
Jacob Thornton 2012-03-21 23:51:32 -07:00
parent 706ee46b73
commit 20e085723b
3 changed files with 8 additions and 6 deletions

Binary file not shown.

View File

@ -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 () {

View File

@ -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 () {