josecebe / twbs-pagination

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

hideOnlyOnePage = true and initiateStartPageClick = false are incompatible #143

Closed dylan-oxide closed 7 years ago

dylan-oxide commented 7 years ago

If you have hideOnlyOnePage = true it triggers a click even if you have initiateStartPageClick = false set to false.

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

my suggestion is to change it to this

// hide if only one page exists
if (this.options.hideOnlyOnePage && this.options.totalPages == 1) {
  if (this.options.initiateStartPageClick) {
    this.$element.trigger('page', 1);
  }
  return this;
}
eugenesimakin commented 7 years ago

Hi! Agree. Will be in next version.