File tree Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -110,25 +110,26 @@ class ScrollSpy extends BaseComponent {
110
110
this . _scrollHeight = this . _getScrollHeight ( )
111
111
112
112
const targets = SelectorEngine . find ( SELECTOR_LINK_ITEMS , this . _config . target )
113
-
114
- for ( const item of targets . map ( element => {
115
- const targetSelector = getSelectorFromElement ( element )
116
- const target = targetSelector ? SelectorEngine . findOne ( targetSelector ) : null
117
-
118
- if ( target ) {
119
- const targetBCR = target . getBoundingClientRect ( )
120
- if ( targetBCR . width || targetBCR . height ) {
121
- return [
122
- Manipulator [ offsetMethod ] ( target ) . top + offsetBase ,
123
- targetSelector
124
- ]
113
+ . map ( element => {
114
+ const targetSelector = getSelectorFromElement ( element )
115
+ const target = targetSelector ? SelectorEngine . findOne ( targetSelector ) : null
116
+
117
+ if ( target ) {
118
+ const targetBCR = target . getBoundingClientRect ( )
119
+ if ( targetBCR . width || targetBCR . height ) {
120
+ return [
121
+ Manipulator [ offsetMethod ] ( target ) . top + offsetBase ,
122
+ targetSelector
123
+ ]
124
+ }
125
125
}
126
- }
127
126
128
- return null
129
- } )
130
- . filter ( item => item )
131
- . sort ( ( a , b ) => a [ 0 ] - b [ 0 ] ) ) {
127
+ return null
128
+ } )
129
+ . filter ( item => item )
130
+ . sort ( ( a , b ) => a [ 0 ] - b [ 0 ] )
131
+
132
+ for ( const item of targets ) {
132
133
this . _offsets . push ( item [ 0 ] )
133
134
this . _targets . push ( item [ 1 ] )
134
135
}
You can’t perform that action at this time.
0 commit comments