File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,17 +5,13 @@ const SetHideContainers = () => {
55
66 if ( ! containers || containers . length === 0 ) return ;
77
8- for ( let _container of containers ) {
9- let _cmsList = _container . querySelector ( '[wt-hidecontainer-element="list"]' ) ;
10- let _r = _container . getAttribute ( 'wt-hidecontainer-remove' ) ;
8+ containers . forEach ( ( cmsContainer ) => {
9+ let _cmsList = cmsContainer . querySelector ( '[wt-hidecontainer-element="list"]' ) ;
1110 if ( ! _cmsList ) return ;
12- if ( _cmsList . classList . contains ( "w-dyn-empty" ) ) {
13- if ( _r ) {
14- _container . remove ( ) ;
15- }
16- else {
17- _container . style . display = 'none' ;
18- }
19- }
20- }
11+ let _r = cmsContainer . getAttribute ( 'wt-hidecontainer-remove' ) ;
12+ if ( _r ) { if ( _cmsList . classList . contains ( "w-dyn-empty" ) ) cmsContainer . remove ( ) ; }
13+ else { if ( _cmsList . classList . contains ( "w-dyn-empty" ) ) cmsContainer . style . display = 'none' ; }
14+ } ) ;
15+
2116}
17+ window . addEventListener ( 'DOMContentLoaded' , SetHideContainers ( ) ) ;
You can’t perform that action at this time.
0 commit comments