Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Default value for contentLoadedCallback in case it is not configured;
Browse files Browse the repository at this point in the history
Throw exception if widgetId is not set.
  • Loading branch information
nirvana-msu committed Jul 24, 2016
1 parent 9ce1193 commit c1029cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion InfiniteScrollPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class InfiniteScrollPager extends Widget
/**
* @var string|JsExpression javascript callback to be executed on loading the content via ajax call
*/
public $contentLoadedCallback;
public $contentLoadedCallback = 'function(){}';

/**
* @var Pagination the pagination object that this pager is associated with.
Expand Down Expand Up @@ -103,6 +103,10 @@ public function init()
throw new InvalidConfigException('The "pagination" property must be set.');
}

if ($this->widgetId === null) {
throw new InvalidConfigException('The "widgetId" property must be set.');
}

// Publish assets and register main plugin code
InfiniteScrollAsset::register($this->view);

Expand Down

0 comments on commit c1029cb

Please sign in to comment.