Skip to content

Commit

Permalink
TMZ-216 adding hidden class with php instead of JS
Browse files Browse the repository at this point in the history
  • Loading branch information
mserino committed Jan 8, 2025
1 parent f2dca6e commit d24b22c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export default class ZigZagHandler extends elementorModules.frontend.handlers.Ba
} );

sortedEntries.forEach( ( entry, index ) => {
entry.target.classList.add( hidden );
if ( entry.isIntersecting && ! entry.target.classList.contains( visible ) ) {
setTimeout( () => {
entry.target.classList.remove( hidden );
Expand Down
10 changes: 9 additions & 1 deletion modules/content/classes/render/widget-zig-zag-render.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,17 @@ public function render(): void {
$graphic_element = $this->settings['graphic_element'];
$repeater = 'image' === $graphic_element ? $this->settings['image_zigzag_items'] : $this->settings['icon_zigzag_items'];

$wrapper_classnames = [
'ehp-zigzag__item-wrapper'

Check failure on line 64 in modules/content/classes/render/widget-zig-zag-render.php

View workflow job for this annotation

GitHub Actions / Lint PHP files

There should be a comma after the last array item in a multi-line array.
];

if ( $has_entrance_animation ) {
$wrapper_classnames[] = 'hidden';
}

foreach ( $repeater as $key => $item ) {
$this->widget->add_render_attribute( 'zigzag-item-wrapper-' . $key, [
'class' => 'ehp-zigzag__item-wrapper',
'class' => $wrapper_classnames,
] );

$this->widget->add_render_attribute( 'zigzag-item-' . $key, [
Expand Down

0 comments on commit d24b22c

Please sign in to comment.