From d6f873dd7e7d3139774bd33f28697a7af08413ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkan=20Karata=C5=9F?= Date: Tue, 23 Feb 2016 11:56:39 +0200 Subject: [PATCH] $next selector option If page has multiple pagination inside, the next selector could not select correct pagination. I have added $next public variable. --- ScrollPager.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ScrollPager.php b/ScrollPager.php index 095803c..bc3c8a7 100644 --- a/ScrollPager.php +++ b/ScrollPager.php @@ -73,6 +73,13 @@ class ScrollPager extends Widget * Make sure the elements are inside the container element. */ public $item = '.item'; + + /** + * @var string $next Enter the selector of the link element that links to the next page. + * The href attribute of this element will be used to get the items from the next page. + * Make sure there is only one(1) element that matches the selector. + */ + public $next = '.next a'; /** * @var int $delay Minimal number of milliseconds to stay in a loading state. @@ -267,7 +274,7 @@ public function run() 'container' => $this->container, 'item' => $this->item, 'pagination' => "{$this->container} .pagination", - 'next' => '.next a', + 'next' => $this->next, 'delay' => $this->delay, 'negativeMargin' => $this->negativeMargin ]); @@ -436,4 +443,4 @@ protected function checkEnabledExtensions($extensions) return (count(array_intersect($this->enabledExtensions, $extensions)) == count($extensions)); } } -} \ No newline at end of file +}