Skip to content

Commit

Permalink
Fix issue imageLoaded is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Oct 24, 2024
1 parent eadf01c commit 9b6dcbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/library/astroid/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ public function loadMasonry($selector = ''): void
}
if (!empty($selector)) {
$this->loadImagesLoaded();
$wa->addInlineScript('jQuery(document).ready(function(){jQuery(\''.$selector.'\').addClass("as-loading");jQuery(\''.$selector.'\').imagesLoaded(function() { jQuery(\''.$selector.'\').masonry({itemSelector: \''.$selector.' > div\',percentPosition: true}); jQuery(\''.$selector.'\').removeClass("as-loading"); });});');
$wa->addInlineScript('jQuery(document).ready(function(){jQuery(\''.$selector.'\').addClass("as-loading");imagesLoaded( document.querySelector(\''.$selector.'\'), function( instance ) { jQuery(\''.$selector.'\').masonry({itemSelector: \''.$selector.' > div\',percentPosition: true}); jQuery(\''.$selector.'\').removeClass("as-loading"); });});');
}
}

Expand All @@ -972,7 +972,7 @@ public function loadSwiper($obj = '', $config = ''): void
}
if (!empty($obj) && !empty($config)) {
$this->loadImagesLoaded();
$wa->addInlineScript('jQuery(document).ready(function(){jQuery(\''.$obj.'\').addClass("as-loading");jQuery(\''.$obj.'\').imagesLoaded( function() {const swiper = new Swiper(\''.$obj.'\', {'.$config.'}); jQuery(\''.$obj.'\').removeClass("as-loading"); });});');
$wa->addInlineScript('jQuery(document).ready(function(){jQuery(\''.$obj.'\').addClass("as-loading");imagesLoaded( document.querySelector(\''.$obj.'\'), function( instance ) {const swiper = new Swiper(\''.$obj.'\', {'.$config.'}); jQuery(\''.$obj.'\').removeClass("as-loading"); });});');
}
}

Expand Down

0 comments on commit 9b6dcbb

Please sign in to comment.