diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2012-03-22 10:59:27 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2012-03-22 10:59:27 +0400 |
commit | b3bf223617754e658eb62ef0f068732e719a2c82 (patch) | |
tree | dec00591263527c896aade8283c0a28d375809e5 /js/bootstrap-scrollspy.js | |
parent | 20e085723b3f55fdc1db7f1687d535af7d127319 (diff) |
filter out non matches in map
Diffstat (limited to 'js/bootstrap-scrollspy.js')
-rw-r--r-- | js/bootstrap-scrollspy.js | 4 |
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 () { |