AddSearch / search-ui

JavaScript library to develop Search UIs for the web
https://www.addsearch.com/
MIT License
24 stars 4 forks source link

make Totalpages available in pagination #55

Closed Lefthandmedia closed 3 years ago

Lefthandmedia commented 3 years ago

To show a visitor how many pages the total result contains we would like the total amount of pages to be available in the pagination.

so we can do something like this <previous 1 2 3 4 5 6 ... 12 next>

This can easily be done in pagination.js at #32

const data = {
      currentPage,
      totalPages,
      lastPage: pageArr ? pageArr[pageArr.length-1] : 0,
      pages: pageArr
    };

Thanks, RDG

anttiai commented 3 years ago

Good idea. We'll deploy this improvement early next week.

anttiai commented 3 years ago

Added in the release 0.4.21.