File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
core/pfe-core/controllers Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 11import type { ReactiveController , ReactiveControllerHost } from 'lit' ;
22
3- import { isServer } from 'lit' ;
4-
53export interface ScrollSpyControllerOptions extends IntersectionObserverInit {
64 /**
75 * Tag names of legal link children.
@@ -35,15 +33,13 @@ export class ScrollSpyController implements ReactiveController {
3533 static #instances = new Set < ScrollSpyController > ;
3634
3735 static {
38- if ( ! isServer ) {
39- addEventListener ( 'scroll' , ( ) => {
40- if ( Math . round ( window . innerHeight + window . scrollY ) >= document . body . scrollHeight ) {
41- this . #instances. forEach ( ssc => {
42- ssc . #setActive( ssc . #linkChildren. at ( - 1 ) ) ;
43- } ) ;
44- }
45- } , { passive : true } ) ;
46- }
36+ addEventListener ( 'scroll' , ( ) => {
37+ if ( Math . round ( window . innerHeight + window . scrollY ) >= document . body . scrollHeight ) {
38+ this . #instances. forEach ( ssc => {
39+ ssc . #setActive( ssc . #linkChildren. at ( - 1 ) ) ;
40+ } ) ;
41+ }
42+ } , { passive : true } ) ;
4743 }
4844
4945 #tagNames: string [ ] ;
You can’t perform that action at this time.
0 commit comments