Skip to content

Commit c342df6

Browse files
authored
bjorn2404#211 - Fix page numbers still display when there are no results
This fixes bjorn2404#211. Moved the handling of "no results" to happen after paginationSetup so that if the new locationset contains no locations then the pagination HTML is removed from the page instead of it still showing the page numbers along with "No Results" on the page.
1 parent 5618893 commit c342df6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/js/jquery.storelocator.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,17 +2510,17 @@
25102510
$this.slideDown();
25112511
}
25122512

2513-
// Handle no results
2514-
if (_this.isEmptyObject(locationset) || locationset[0].result === 'none') {
2515-
_this.emptyResult();
2516-
return;
2517-
}
2518-
25192513
// Output page numbers if pagination setting is true
25202514
if (_this.settings.pagination === true) {
25212515
_this.paginationSetup(page);
25222516
}
25232517

2518+
// Handle no results
2519+
if (_this.isEmptyObject(locationset) || locationset[0].result === 'none') {
2520+
_this.emptyResult();
2521+
return;
2522+
}
2523+
25242524
// Set up the modal window
25252525
_this.modalWindow();
25262526

0 commit comments

Comments
 (0)