From 38486bb915e6b34ae436601f4d71aaafa2a704fa Mon Sep 17 00:00:00 2001 From: Sonny Le Date: Tue, 29 Oct 2024 15:42:58 +0700 Subject: [PATCH] Improve call masonry function --- framework/elements/articles/articles.php | 2 +- framework/elements/grid/grid.php | 2 +- framework/elements/imagegroup/imagegroup.php | 2 +- framework/elements/testimonials/testimonials.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/elements/articles/articles.php b/framework/elements/articles/articles.php index fb9380f3..b9eaafa1 100644 --- a/framework/elements/articles/articles.php +++ b/framework/elements/articles/articles.php @@ -404,7 +404,7 @@ } } elseif ($use_masonry) { - $document->loadMasonry('.as-masonry'); + $document->loadMasonry('#'. $element->id .' .as-masonry'); } if ($params->get('card_size', '') == 'custom') { $card_padding = $params->get('card_padding', ''); diff --git a/framework/elements/grid/grid.php b/framework/elements/grid/grid.php index 055ff654..2905857b 100644 --- a/framework/elements/grid/grid.php +++ b/framework/elements/grid/grid.php @@ -253,7 +253,7 @@ } echo ''; if ($use_masonry) { - $document->loadMasonry('.as-masonry'); + $document->loadMasonry('#'. $element->id .' .as-masonry'); } $style->child('.astroid-icon')->addCss('font-size', $icon_size.'px'); if ($params->get('card_size', '') == 'custom') { diff --git a/framework/elements/imagegroup/imagegroup.php b/framework/elements/imagegroup/imagegroup.php index e8106f50..fe57f701 100644 --- a/framework/elements/imagegroup/imagegroup.php +++ b/framework/elements/imagegroup/imagegroup.php @@ -205,7 +205,7 @@ if ($enable_slider) { $document->loadSlick('#'.$element->id.' .astroid-slick', implode(',', $slide_settings)); } elseif ($use_masonry) { - $document->loadMasonry('.as-masonry'); + $document->loadMasonry('#'. $element->id .' .as-masonry'); } if ($enable_image_cover) { diff --git a/framework/elements/testimonials/testimonials.php b/framework/elements/testimonials/testimonials.php index 2a72d25b..bca6f466 100644 --- a/framework/elements/testimonials/testimonials.php +++ b/framework/elements/testimonials/testimonials.php @@ -304,7 +304,7 @@ $wa->registerAndUseScript('slick.js', 'astroid/slick.min.js', ['relative' => true, 'version' => 'auto'], [], ['jquery']); echo ''; } elseif ($use_masonry) { - $document->loadMasonry('.as-masonry'); + $document->loadMasonry('#'. $element->id .' .as-masonry'); } if ($params->get('card_size', '') == 'custom') {