josecebe / twbs-pagination

jQuery pagination plugin (bootstrap powered)
http://josecebe.github.io/twbs-pagination/
Other
1.1k stars 405 forks source link

hideOnlyOnePage and initiateStartPageClick combined #167

Closed gkallergis closed 6 years ago

gkallergis commented 6 years ago

Hello! I am trying to use the paging plugin with initiateStartPageClick set to false in order not to send an initial request out for the first page since I have the data already. Nonetheless, the event is being fired due to the fact that I have the hideOnlyOnePage option set to true to hide paging when there is only one page of data.

I thing the problem is in the following lines (jquery.twbsPagination.js 40-43):

if (this.options.hideOnlyOnePage && this.options.totalPages == 1) { this.$element.trigger('page', 1); return this; }

If the option to hide the paging selectors when data is only one page is set to true, then a page change is triggered no matter what the value of hideOnlyOnePage is.

Unless I am missing a specific use case of course :)

krisgerhard commented 6 years ago

I'm facing the same issue. Similar issue was closed 29 May 2017 https://github.com/esimakin/twbs-pagination/issues/143

TarasTD commented 6 years ago

same issue for me :(

josecebe commented 6 years ago

Hi @gekallergis , @KrisGerhard and @TarasTD ,

I have fixed this issue, you can test it in 'master' branch. It will be released in 1.4.2 tag (August 1, 2018).

gkallergis commented 6 years ago

On my birthdyay :D Thanks a lot for rhe fix

Glideh commented 5 years ago

I still have the issue, I guess it's not released yet.