File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11< script >
22 window . deep = window . deep || { } ;
33
4+ // TODO: JSDoc
45 ElementBehaviorImpl = {
56 properties : {
67 /* True if the element is visible to the user. False otherwise. */
7- isVisible : {
8+ isVisibleToUser : {
89 type : Boolean ,
910 value : false
1011 } ,
1112 /* Observer monitoring resize events */
1213 __resizeObserver : Object
1314 } ,
1415 attached ( ) {
15- this . __resizeObserver = new ResizeObserver ( this . __updateVisibility ) ;
16+ this . __resizeObserver = new ResizeObserver ( this . __updateVisibility . bind ( this ) ) ;
1617 this . __resizeObserver . observe ( this ) ;
1718 } ,
1819 detached ( ) {
19-
20+ this . __resizeObserver . disconnect ( ) ;
2021 } ,
2122 __updateVisibility ( resizeEntries ) {
2223 if ( ! Array . isArray ( resizeEntries ) || ! resizeEntries . length ) return ;
2324 const boundingRectangle = resizeEntries [ 0 ] . contentRect ;
2425 const { height, width} = boundingRectangle ;
25- this . set ( 'isVisible ' , Boolean ( height ) || Boolean ( width ) ) ;
26+ this . set ( 'isVisibleToUser ' , Boolean ( height ) || Boolean ( width ) ) ;
2627 }
2728 } ;
2829 deep . ElementBehavior = [ ElementBehaviorImpl ] ;
You can’t perform that action at this time.
0 commit comments