Skip to content

Commit

Permalink
Merge branch 'bugfix/pagination' into 'master'
Browse files Browse the repository at this point in the history
Bugfix/pagination

See merge request pdir/maklermodul-bundle!34
  • Loading branch information
MDevster committed Nov 14, 2024
2 parents 7898bb3 + a9f4cbf commit 8d69d41
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ Types of changes
Security in case of vulnerabilities.
)

## [2.9.4](https://github.com/pdir/maklermodul-bundle/tree/2.9.4) – 2024-xx-xx
## [2.9.5](https://github.com/pdir/maklermodul-bundle/tree/2.9.5) – 2024-11-07

- [Fixed] fix pagination after resetting the filter
- [Fixed] fix number of pagination items

## [2.9.4](https://github.com/pdir/maklermodul-bundle/tree/2.9.4) – 2024-11-04

- [Fixed] show attachments if group is empty

Expand Down
2 changes: 1 addition & 1 deletion src/Module/ListView.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ protected function compile()
$pages[] = $json['data'];
}

$this->Template->pageCount = $pageCount;
$this->Template->pageCount = ceil(($count - 1) / $this->makler_paginationCount);
$this->Template->page = !(int) $this->Input->get('page') ? (int) $this->Input->get('page') : 0;
$this->Template->listObjects = $json['data'] ? $pages : null;

Expand Down
24 changes: 17 additions & 7 deletions src/Resources/public/js/estate.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,7 @@
delete listView.qsSelector;
delete listView.selectFilter;
delete listView.qsString;

listView.pagination.show();
listView.resetPagination();

// reset range
delete listView.rangeFilter;
Expand All @@ -409,6 +408,13 @@
listView.filter("*");
};

listView.resetPagination = function () {
listView.pagination.show();
listView.pagination.find('li').removeClass('active');
listView.pagination.find('li:first-child').addClass('active');
listView.activePage.html(listView.pagination.find('li:first-child a').text());
};

listView.shuffle = function () {
listView.estateList.isotope('shuffle');
};
Expand Down Expand Up @@ -498,10 +504,12 @@
filters = filters.join(''); //AND
}

if (filters === '')
if (filters === '') {
delete listView.checkboxFilter;
else
listView.resetPagination();
} else {
listView.checkboxFilter = filters;
}

// call filter
listView.filter();
Expand Down Expand Up @@ -536,10 +544,12 @@
filters = filters.join(''); //AND
}

if (filters === '')
if (filters === '') {
delete listView.selectFilter;
else
listView.resetPagination();
} else {
listView.selectFilter = filters;
}

listView.selectFilter = filters;

Expand Down Expand Up @@ -678,7 +688,7 @@
// @todo deactivate via modul $('html,body').animate({ scrollTop: $("#slider .mod_article.last").offset().top - 85 }, 600);

// update active pagination page
listView.activePage.html($(this).attr('title'));
listView.activePage.html($(this).text());

listView.filter();
};
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Helper extends Frontend
/**
* maklermodul version.
*/
const VERSION = '2.9.4';
const VERSION = '2.9.5';

/**
* Extension mode.
Expand Down

0 comments on commit 8d69d41

Please sign in to comment.