BigW Consortium Gitlab

Commit 59560758 by Regis

cleanup

parent f4a52de3
...@@ -26,13 +26,11 @@ ...@@ -26,13 +26,11 @@
computed: { computed: {
last() { return Math.ceil(+this.count / 5); }, last() { return Math.ceil(+this.count / 5); },
getItems() { getItems() {
const total = +this.count; const total = +this.last;
const page = +this.pagenum; const page = +this.pagenum;
const items = []; const items = [];
if (page > 1) { if (page > 1) items.push({ title: '<< First', where: 1 });
items.push({ title: '<< First', where: 1 });
}
if (page > 1) { if (page > 1) {
items.push({ title: 'Prev', where: page - 1 }); items.push({ title: 'Prev', where: page - 1 });
...@@ -40,9 +38,7 @@ ...@@ -40,9 +38,7 @@
items.push({ title: 'Prev', where: page - 1, disabled: true }); items.push({ title: 'Prev', where: page - 1, disabled: true });
} }
if (page > 6) { if (page > 6) items.push({ title: '...', separator: true });
items.push({ title: '...', separator: true });
}
const start = Math.max(page - 4, 1); const start = Math.max(page - 4, 1);
const end = Math.min(page + 4, total); const end = Math.min(page + 4, total);
...@@ -52,9 +48,7 @@ ...@@ -52,9 +48,7 @@
items.push({ title: i, active: isActive, where: i }); items.push({ title: i, active: isActive, where: i });
} }
if (total - page > 4) { if (total - page > 4) items.push({ title: '...', separator: true });
items.push({ title: '...', separator: true });
}
if (page === total) { if (page === total) {
items.push({ title: 'Next', where: page + 1, disabled: true }); items.push({ title: 'Next', where: page + 1, disabled: true });
...@@ -62,9 +56,7 @@ ...@@ -62,9 +56,7 @@
items.push({ title: 'Next', where: page + 1 }); items.push({ title: 'Next', where: page + 1 });
} }
if (total - page >= 1) { if (total - page >= 1) items.push({ title: 'Last >>', where: total });
items.push({ title: 'Last >>', where: total });
}
return items; return items;
}, },
......
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