@@ -50,40 +50,6 @@ const hackJSResize = function () {
5050 }
5151}
5252
53- const checkVisibility = el => {
54- if ( el . checkVisibility ) {
55- return el . checkVisibility ( ) ;
56- }
57- else {
58- return isVisible ( el ) ;
59- }
60- }
61-
62- const isVisible = ( element ) => {
63- if ( ! element ) return false ;
64-
65- const style = window . getComputedStyle ( element ) ;
66- if ( style . display === 'none' || style . visibility === 'hidden' || parseFloat ( style . opacity ) < 0.01 ) {
67- return false ;
68- }
69-
70- const rect = element . getBoundingClientRect ( ) ;
71- if ( rect . width === 0 || rect . height === 0 ) {
72- return false ;
73- }
74-
75- let parent = element . parentElement ;
76- while ( parent ) {
77- const parentStyle = window . getComputedStyle ( parent ) ;
78- if ( parentStyle . display === 'none' || parentStyle . visibility === 'hidden' ) {
79- return false ;
80- }
81- parent = parent . parentElement ;
82- }
83-
84- return true ;
85- }
86-
8753const hackJSShowWnd = function ( ) {
8854 const originalShowWnd = JSVideoPlugin . prototype . JS_ShowWnd ;
8955 JSVideoPlugin . prototype . JS_ShowWnd = function ( ) {
@@ -402,3 +368,37 @@ const getTagNameFirstValue = (xmlDoc, tagName, defaultValue = '0') => {
402368const getTagNameValues = ( xmlDoc , tagName ) => {
403369 return xmlDoc . getElementsByTagName ( tagName ) ;
404370}
371+
372+ const checkVisibility = el => {
373+ if ( el . checkVisibility ) {
374+ return el . checkVisibility ( ) ;
375+ }
376+ else {
377+ return isVisible ( el ) ;
378+ }
379+ }
380+
381+ const isVisible = ( element ) => {
382+ if ( ! element ) return false ;
383+
384+ const style = window . getComputedStyle ( element ) ;
385+ if ( style . display === 'none' || style . visibility === 'hidden' || parseFloat ( style . opacity ) < 0.01 ) {
386+ return false ;
387+ }
388+
389+ const rect = element . getBoundingClientRect ( ) ;
390+ if ( rect . width === 0 || rect . height === 0 ) {
391+ return false ;
392+ }
393+
394+ let parent = element . parentElement ;
395+ while ( parent ) {
396+ const parentStyle = window . getComputedStyle ( parent ) ;
397+ if ( parentStyle . display === 'none' || parentStyle . visibility === 'hidden' ) {
398+ return false ;
399+ }
400+ parent = parent . parentElement ;
401+ }
402+
403+ return true ;
404+ }
0 commit comments