BigW Consortium Gitlab

Commit 79f6e08c by Regis

use switch for pagination

parent 6bf0bd0f
......@@ -66,18 +66,24 @@
const text = e.target.innerText;
const { totalPages, nextPage, previousPage } = this.pageInfo;
if (text === SPREAD) {
return;
} else if (text === LAST) {
pageNum = totalPages;
} else if (text === NEXT) {
pageNum = nextPage;
} else if (text === PREV) {
pageNum = previousPage;
} else if (text === FIRST) {
pageNum = 1;
} else {
pageNum = +text;
switch (text) {
case SPREAD:
break;
case LAST:
pageNum = totalPages;
break;
case NEXT:
pageNum = nextPage;
break;
case PREV:
pageNum = previousPage;
break;
case FIRST:
pageNum = 1;
break;
default:
pageNum = +text;
break;
}
this.change(pageNum, apiScope);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment