From: Jacob Thornton Date: Thu, 22 Mar 2012 06:59:27 +0000 (-0700) Subject: filter out non matches in map X-Git-Tag: v2.0.3~5^2~108^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b3bf223617754e658eb62ef0f068732e719a2c82;p=thirdparty%2Fbootstrap.git filter out non matches in map --- diff --git a/docs/assets/bootstrap.zip b/docs/assets/bootstrap.zip index 72d0da0065..abd205cd1d 100644 Binary files a/docs/assets/bootstrap.zip and b/docs/assets/bootstrap.zip differ diff --git a/docs/assets/js/bootstrap-scrollspy.js b/docs/assets/js/bootstrap-scrollspy.js index 487e6818b1..bd3f106044 100644 --- a/docs/assets/js/bootstrap-scrollspy.js +++ b/docs/assets/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 () { 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 () {