Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2012-03-22 10:51:32 +0400
committerJacob Thornton <jacobthornton@gmail.com>2012-03-22 10:51:32 +0400
commit20e085723b3f55fdc1db7f1687d535af7d127319 (patch)
tree22bda2e4fb0391d3a336883e3ac8598b71f9cbf6 /docs/assets/js/bootstrap-scrollspy.js
parent706ee46b73b58059230b24589160da784778aad2 (diff)
cache $(href) lookup
Diffstat (limited to 'docs/assets/js/bootstrap-scrollspy.js')
-rw-r--r--docs/assets/js/bootstrap-scrollspy.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/assets/js/bootstrap-scrollspy.js b/docs/assets/js/bootstrap-scrollspy.js
index 5008b0fe97..487e6818b1 100644
--- a/docs/assets/js/bootstrap-scrollspy.js
+++ b/docs/assets/js/bootstrap-scrollspy.js
@@ -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 () {