File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 44 window . deep = window . deep || { } ;
55
66 // TODO: JSDoc
7- ElementBehaviorImpl = {
7+ const ElementBehaviorImpl = {
88 properties : {
99 /* True if the element is visible to the user. False otherwise. */
1010 isVisibleToUser : {
1111 type : Boolean ,
12- value : false
13- }
12+ value : false ,
13+ } ,
1414 } ,
1515 attached ( ) {
1616 // NOTE: A null root defaults to the device view port.
1717 this . __visibilityObserver = new IntersectionObserver ( this . __updateVisibility . bind ( this ) , {
1818 root : this . parentNode || null ,
19- threshold : [ 0 , 1.0 ]
19+ threshold : [ 0 , 1.0 ] ,
2020 } ) ;
2121 this . __visibilityObserver . observe ( this ) ;
2222
2929 this . __visibilityObserver . disconnect ( ) ;
3030 } ,
3131 __updateVisibility ( entries ) {
32- if ( ! Array . isArray ( entries ) || ! entries . length ) return ;
32+ if ( ! Array . isArray ( entries ) || ! entries . length ) return ;
3333 const boundingRectangle = entries [ 0 ] . boundingClientRect || { height : 0 , width : 0 } ;
3434 const { height, width} = boundingRectangle ;
3535 this . set ( 'isVisibleToUser' , Boolean ( height ) || Boolean ( width ) ) ;
36- }
36+ } ,
3737 } ;
38- deep . ElementBehavior = [ ElementBehaviorImpl ] ;
38+
39+ window . deep . ElementBehavior = [ ElementBehaviorImpl ] ;
3940</ script >
You can’t perform that action at this time.
0 commit comments