mirror of
https://github.com/twbs/bootstrap.git
synced 2025-10-24 00:03:40 -04:00
filter out non matches in map
This commit is contained in:
parent
20e085723b
commit
b3bf223617
Binary file not shown.
4
docs/assets/js/bootstrap-scrollspy.js
vendored
4
docs/assets/js/bootstrap-scrollspy.js
vendored
@ -54,9 +54,9 @@
|
|||||||
.map(function () {
|
.map(function () {
|
||||||
var href = $(this).attr('href')
|
var href = $(this).attr('href')
|
||||||
, $href = /^#\w/.test(href) && $(href)
|
, $href = /^#\w/.test(href) && $(href)
|
||||||
return $href
|
return ( $href
|
||||||
&& href.length
|
&& href.length
|
||||||
&& [[ $href.position().top, href ]]
|
&& [[ $href.position().top, href ]] ) || null
|
||||||
})
|
})
|
||||||
.sort(function (a, b) { return a[0] - b[0] })
|
.sort(function (a, b) { return a[0] - b[0] })
|
||||||
.each(function () {
|
.each(function () {
|
||||||
|
|||||||
4
js/bootstrap-scrollspy.js
vendored
4
js/bootstrap-scrollspy.js
vendored
@ -54,9 +54,9 @@
|
|||||||
.map(function () {
|
.map(function () {
|
||||||
var href = $(this).attr('href')
|
var href = $(this).attr('href')
|
||||||
, $href = /^#\w/.test(href) && $(href)
|
, $href = /^#\w/.test(href) && $(href)
|
||||||
return $href
|
return ( $href
|
||||||
&& href.length
|
&& href.length
|
||||||
&& [[ $href.position().top, href ]]
|
&& [[ $href.position().top, href ]] ) || null
|
||||||
})
|
})
|
||||||
.sort(function (a, b) { return a[0] - b[0] })
|
.sort(function (a, b) { return a[0] - b[0] })
|
||||||
.each(function () {
|
.each(function () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user