Using widget LazyLoad in another widgets (For example ListView).
I add this widget in 'itemView' partial view of ListView widget.
What is the expected result?
lazyload.js must load.
What do you get instead? (A Screenshot can help us a lot!)
Don`t load lazyload.js lib.
LUYA Check ouput (run this script and post the result: luyacheck.php)
Additional infos
It's happend because static::$counter of class Widget already has counted +1 in ListView widget.
In my case, I extended LazyLoad class and add local counter:
<?php
...
class LazyLoadExt extends Widget
{
...
public static $localCounter = 0;
...
public function init()
{
...
static::$localCounter++;
static::$counter++;
if (static::$localCounter== 1) {
LazyLoadAsset::register($this->view);
$this->view->registerJs("$('.lazy-image').lazyLoad();", View::POS_READY);
$this->view->registerCss(".lazy-image { display: none; }");
}
}
...
}
?>
What steps will reproduce the problem?
Using widget LazyLoad in another widgets (For example ListView). I add this widget in 'itemView' partial view of ListView widget.
What is the expected result?
lazyload.js must load.
What do you get instead? (A Screenshot can help us a lot!)
Don`t load lazyload.js lib.
LUYA Check ouput (run this script and post the result: luyacheck.php)
Additional infos
It's happend because static::$counter of class Widget already has counted +1 in ListView widget. In my case, I extended LazyLoad class and add local counter: