File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
addon/components/collection-scroll-view/collection-items Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,12 @@ import Component from '@glimmer/component';
5
5
import identity from 'ember-collection/utils/identity' ;
6
6
import { tracked } from '@glimmer/tracking' ;
7
7
import { reads } from 'macro-decorators' ;
8
- import { schedule } from '@ember/runloop' ;
9
8
10
9
function isElementInViewport ( el ) {
11
- var rect = el . getBoundingClientRect ( ) ;
12
- return (
13
- rect . top >= 0 &&
14
- rect . left >= 0 &&
15
- rect . bottom <= ( window . innerHeight || document . documentElement . clientHeight ) &&
16
- rect . right <= ( window . innerWidth || document . documentElement . clientWidth )
17
- ) ;
10
+ let rect = el . getBoundingClientRect ( ) ;
11
+ let windowHeight = ( window . innerHeight || document . documentElement . clientHeight ) ;
12
+ return ( rect . top > 0 && rect . top < windowHeight ) ||
13
+ ( rect . bottom > 0 && rect . bottom < windowHeight ) ;
18
14
}
19
15
20
16
let scrollViewCollectionItemsCellCounter = 0 ;
You can’t perform that action at this time.
0 commit comments