Skip to content

Commit

Permalink
Hide the pagination if pageSize === 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Hector Romero committed Jul 23, 2017
1 parent a29a807 commit b5ed61e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
6 changes: 5 additions & 1 deletion dist/amd/au-table-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ define(['exports', 'aurelia-framework'], function (exports, _aureliaFramework) {
};

AutPaginationCustomElement.prototype.calculatePages = function calculatePages() {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
if (this.pageSize === 0) {
this.totalPages = 1;
} else {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
}

if (isNaN(this.paginationSize) || this.paginationSize <= 0) {
this.displayAllPages();
Expand Down
6 changes: 5 additions & 1 deletion dist/commonjs/au-table-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ var AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0
};

AutPaginationCustomElement.prototype.calculatePages = function calculatePages() {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
if (this.pageSize === 0) {
this.totalPages = 1;
} else {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
}

if (isNaN(this.paginationSize) || this.paginationSize <= 0) {
this.displayAllPages();
Expand Down
6 changes: 5 additions & 1 deletion dist/es2015/au-table-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ export let AutPaginationCustomElement = (_dec = bindable({ defaultBindingMode: b
}

calculatePages() {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
if (this.pageSize === 0) {
this.totalPages = 1;
} else {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
}

if (isNaN(this.paginationSize) || this.paginationSize <= 0) {
this.displayAllPages();
Expand Down
6 changes: 5 additions & 1 deletion dist/system/au-table-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ System.register(['aurelia-framework'], function (_export, _context) {
};

AutPaginationCustomElement.prototype.calculatePages = function calculatePages() {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
if (this.pageSize === 0) {
this.totalPages = 1;
} else {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
}

if (isNaN(this.paginationSize) || this.paginationSize <= 0) {
this.displayAllPages();
Expand Down
6 changes: 5 additions & 1 deletion src/au-table-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export class AutPaginationCustomElement {
}

calculatePages() {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
if (this.pageSize === 0) {
this.totalPages = 1
}else {
this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);
}

if (isNaN(this.paginationSize) || this.paginationSize <= 0) {
this.displayAllPages();
Expand Down

0 comments on commit b5ed61e

Please sign in to comment.