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:59:27 +0400
committerJacob Thornton <jacobthornton@gmail.com>2012-03-22 10:59:27 +0400
commitb3bf223617754e658eb62ef0f068732e719a2c82 (patch)
treedec00591263527c896aade8283c0a28d375809e5 /js/bootstrap-scrollspy.js
parent20e085723b3f55fdc1db7f1687d535af7d127319 (diff)
filter out non matches in map
Diffstat (limited to 'js/bootstrap-scrollspy.js')
-rw-r--r--js/bootstrap-scrollspy.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/bootstrap-scrollspy.js b/js/bootstrap-scrollspy.js
index 487e6818b1..bd3f106044 100644
--- a/js/bootstrap-scrollspy.js
+++ b/js/bootstrap-scrollspy.js
@@ -54,9 +54,9 @@
.map(function () {
var href = $(this).attr('href')
, $href = /^#\w/.test(href) && $(href)
- return $href
+ return ( $href
&& href.length
- && [[ $href.position().top, href ]]
+ && [[ $href.position().top, href ]] ) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {