|
3 | 3 | namespace kop\y2sp; |
4 | 4 |
|
5 | 5 | use kop\y2sp\assets\InfiniteAjaxScrollAsset; |
| 6 | +use Yii; |
6 | 7 | use yii\base\InvalidConfigException; |
7 | 8 | use yii\base\Widget; |
8 | 9 | use yii\helpers\ArrayHelper; |
|
11 | 12 | use yii\web\JsExpression; |
12 | 13 | use yii\web\View; |
13 | 14 | use yii\widgets\LinkPager; |
14 | | -use Yii; |
15 | 15 |
|
16 | 16 | /** |
17 | 17 | * ScrollPager turns your regular paginated page into an infinite scrolling page using AJAX. |
@@ -240,7 +240,7 @@ public function init() |
240 | 240 | ]); |
241 | 241 |
|
242 | 242 | // Register required assets |
243 | | - InfiniteAjaxScrollAsset::register($this->view); |
| 243 | + $this->registerAssets(); |
244 | 244 |
|
245 | 245 | // Set default trigger text if not set |
246 | 246 | if ($this->triggerText === null) { |
@@ -340,6 +340,17 @@ public function run() |
340 | 340 | ]); |
341 | 341 | } |
342 | 342 |
|
| 343 | + /** |
| 344 | + * Register required asset bundles. |
| 345 | + * |
| 346 | + * You can override this method in case if you want to use your own JQuery Infinite Ajax Scroll plugin files |
| 347 | + * (for example, some forked plugin version). |
| 348 | + */ |
| 349 | + protected function registerAssets() |
| 350 | + { |
| 351 | + InfiniteAjaxScrollAsset::register($this->view); |
| 352 | + } |
| 353 | + |
343 | 354 | /** |
344 | 355 | * Register jQuery IAS extensions. |
345 | 356 | * |
@@ -419,7 +430,7 @@ protected function registerEventHandlers(array $config) |
419 | 430 | */ |
420 | 431 | protected function checkEnabledExtensions($extensions) |
421 | 432 | { |
422 | | - $extensions = (array) $extensions; |
| 433 | + $extensions = (array)$extensions; |
423 | 434 | if (empty($extensions)) { |
424 | 435 | return true; |
425 | 436 | } else { |
|
0 commit comments