PluginProbe
Elementor Website Builder – more than just a page builder / 3.26.2
Elementor Website Builder – more than just a page builder v3.26.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | modules/lazyload/module.php +5 -5 4.1.03.26.2 View file →
@@ -4,9 +4,9 @@
4 4 use Elementor\Core\Base\Module as BaseModule;
5 5 use Elementor\Plugin;
6 6
7 7 if ( ! defined( 'ABSPATH' ) ) {
8 - exit; // Exit if accessed directly.
8 + exit; // Exit if accessed directly
9 9 }
10 10
11 11 class Module extends BaseModule {
12 12
@@ -25,9 +25,9 @@
25 25 return;
26 26 }
27 27
28 28 add_action( 'wp_head', function() {
29 - if ( ! $this->should_lazy_load_background_images() ) {
29 + if ( ! $this->should_lazyload() ) {
30 30 return;
31 31 }
32 32 ?>
33 33 <style>
@@ -51,13 +51,13 @@
51 51 <?php
52 52 } );
53 53
54 54 add_action( 'wp_footer', function() {
55 - if ( ! $this->should_lazy_load_background_images() ) {
55 + if ( ! $this->should_lazyload() ) {
56 56 return;
57 57 }
58 58 ?>
59 - <script>
59 + <script type='text/javascript'>
60 60 const lazyloadRunObserver = () => {
61 61 const lazyloadBackgrounds = document.querySelectorAll( `.e-con.e-parent:not(.e-lazyloaded)` );
62 62 const lazyloadBackgroundObserver = new IntersectionObserver( ( entries ) => {
63 63 entries.forEach( ( entry ) => {
@@ -85,9 +85,9 @@
85 85 <?php
86 86 } );
87 87 }
88 88
89 - private function should_lazy_load_background_images(): bool {
89 + private function should_lazyload() {
90 90 return ! is_admin() && ! Plugin::$instance->preview->is_preview_mode() && ! Plugin::$instance->editor->is_edit_mode();
91 91 }
92 92
93 93 private static function is_lazy_load_background_images_enabled(): bool {