| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | * |
| 47 | 47 | * @access private |
| 48 | 48 | * @var bool |
| 49 | 49 | */ |
| 50 | - private $lazy_render_script = false; | |
| 50 | + private $lazy_render_script = true; | |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Constructor. |
| 54 | 54 | * |
| @@ -382,10 +382,11 @@ | ||
| 382 | 382 | |
| 383 | 383 | $lazy_load = isset( $settings['lazy_load_chart'] ) ? $settings['lazy_load_chart'] : false; |
| 384 | 384 | $lazy_load = apply_filters( 'visualizer_lazy_load_chart', $lazy_load, $chart->ID ); |
| 385 | 385 | $container_class = 'visualizer-front-container'; |
| 386 | - if ( $lazy_load ) { | |
| 387 | - $this->lazy_render_script = true; | |
| 386 | + if ( ! $lazy_load ) { | |
| 387 | + $this->lazy_render_script = false; | |
| 388 | + } else { | |
| 388 | 389 | $container_class .= ' visualizer-lazy-render'; |
| 389 | 390 | } |
| 390 | 391 | |
| 391 | 392 | // handle data filter hooks |
| @@ -517,9 +518,9 @@ | ||
| 517 | 518 | if ( Visualizer_Module::is_pro() && $enable_controls ) { |
| 518 | 519 | $actions_div .= '<div id="control_wrapper_' . $id . '"></div>'; |
| 519 | 520 | } |
| 520 | 521 | // return placeholder div |
| 521 | - return '<div class="' . $container_class . '" id="chart_wrapper_' . $id . '">' . $actions_div . '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '></div>' . $this->addSchema( $chart->ID ) . ( ! Visualizer_Module::is_pro() ? ( '<' . 'di' . 'v st' . 'yl' . 'e="' . 'op' . 'a' . 'ci' . 't' . 'y:' . '0' . '.7' . ';t' . 'ex' . 't-a' . 'li' . 'gn:' . 'ri' . 'gh' . 't;b' . 'o' . 'tto' . 'm: 1' . '0px; z-i' . 'nd' . 'ex:1' . '00' . '0; ' . 'le' . 'ft' . ':2' . '0px' . '; fo' . 'nt-si' . 'ze: 1' . '4px">' . $prefix . ' b' . 'y' . ' <a ' . 'h' . 're' . 'f="ht' . 'tp' . 's:/' . '/t' . 'he' . 'me' . 'i' . 'sl' . 'e' . '.c' . 'om' . '/p' . 'lu' . 'gi' . 'ns' . '/v' . 'i' . 'su' . 'al' . 'iz' . 'er' . '-c' . 'ha' . 'rts' . '-a' . 'nd' . '-gr' . 'ap' . 'hs' . '/" t' . 'arg' . 'et="' . '_bl' . 'an' . 'k" re' . 'l=' . '"no' . 'fol' . 'l' . 'ow"' . '>V' . 'is' . 'u' . 'a' . 'l' . 'i' . 'z' . 'e' . 'r' . '</' . 'a' . '>' . '<' . '/' . 'd' . 'i' . 'v' . '>' ) : '' ) . '</div>'; | |
| 522 | + return '<div class="' . $container_class . '" id="chart_wrapper_' . $id . '">' . $actions_div . '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '></div>' . $this->addSchema( $chart->ID ) . '</div>'; | |
| 522 | 523 | } |
| 523 | 524 | |
| 524 | 525 | /** |
| 525 | 526 | * Converts the array of attributes to a string of HTML attributes. |
| @@ -698,8 +699,9 @@ | ||
| 698 | 699 | if ( $this->lazy_render_script ) { |
| 699 | 700 | ?> |
| 700 | 701 | <script type="text/javascript"> |
| 701 | 702 | var visualizerUserInteractionEvents = [ |
| 703 | + "scroll", | |
| 702 | 704 | "mouseover", |
| 703 | 705 | "keydown", |
| 704 | 706 | "touchmove", |
| 705 | 707 | "touchstart" |