Skip to content

Commit

Permalink
$next selector option
Browse files Browse the repository at this point in the history
If page has multiple pagination inside, the next selector could not select correct pagination.
I have added $next public variable.
  • Loading branch information
karataserkan committed Feb 23, 2016
1 parent 08b19ab commit d6f873d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ScrollPager.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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
]);
Expand Down Expand Up @@ -436,4 +443,4 @@ protected function checkEnabledExtensions($extensions)
return (count(array_intersect($this->enabledExtensions, $extensions)) == count($extensions));
}
}
}
}

0 comments on commit d6f873d

Please sign in to comment.