Skip to content

Commit f2d8073

Browse files
committed
Fixed paging
1 parent 141761e commit f2d8073

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 1.1.3
4+
5+
Fixed: 1.1.2 broke paging...
6+
37
### 1.1.2
48

59
Fixed: Fixed issue with pager not updating properly if other events updated the collection

src/Leaves/Pager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ protected function onModelCreated()
7878
public function setCollection(Collection $collection)
7979
{
8080
$this->collection = $collection;
81-
// Reset the number of pages so when rendered it gets recalculated
82-
$this->model->numberOfPages = null;
81+
// Recalculate the number of pages.
82+
$this->model->numberOfPages = $this->calculateNumberOfPages();
8383
try {
8484
$this->setPageNumber($this->model->pageNumber);
8585
} catch (PagerOutOfBoundsException $ex) {

0 commit comments

Comments
 (0)