|
@@ -16,7 +16,7 @@ class WBPagination extends Component { |
|
|
visible[i] = true;
|
|
|
visible[i] = true;
|
|
|
|
|
|
|
|
|
visible = Object.keys(visible).map(n => Number(n));
|
|
|
visible = Object.keys(visible).map(n => Number(n));
|
|
|
visible.sort();
|
|
|
|
|
|
|
|
|
visible.sort((a, b) => (a - b));
|
|
|
|
|
|
|
|
|
let res = [];
|
|
|
let res = [];
|
|
|
let prev = 0;
|
|
|
let prev = 0;
|
|
@@ -24,7 +24,7 @@ class WBPagination extends Component { |
|
|
res.push((
|
|
|
res.push((
|
|
|
<li class={ activePage === 0 ? "page-item disabled" : "page-item" }>
|
|
|
<li class={ activePage === 0 ? "page-item disabled" : "page-item" }>
|
|
|
<a class="page-link" href="#"
|
|
|
<a class="page-link" href="#"
|
|
|
onclick={ () => onPageChanged(activePage - 1) }>Previous</a>
|
|
|
|
|
|
|
|
|
onclick={ e => { e.preventDefault(); onPageChanged(activePage - 1); } }>Previous</a>
|
|
|
</li>
|
|
|
</li>
|
|
|
));
|
|
|
));
|
|
|
|
|
|
|
|
@@ -34,7 +34,7 @@ class WBPagination extends Component { |
|
|
res.push((
|
|
|
res.push((
|
|
|
<li class="page-item">
|
|
|
<li class="page-item">
|
|
|
<a class="page-link" href="#"
|
|
|
<a class="page-link" href="#"
|
|
|
onclick={ () => onPageChanged(i - 1) }>...</a>
|
|
|
|
|
|
|
|
|
onclick={ e => { e.preventDefault(); onPageChanged(i - 1); } }>...</a>
|
|
|
</li>
|
|
|
</li>
|
|
|
));
|
|
|
));
|
|
|
prev = i;
|
|
|
prev = i;
|
|
@@ -42,7 +42,7 @@ class WBPagination extends Component { |
|
|
res.push((
|
|
|
res.push((
|
|
|
<li class={ i === activePage ? "page-item active" : "page-item" }>
|
|
|
<li class={ i === activePage ? "page-item active" : "page-item" }>
|
|
|
<a class="page-link" href="#"
|
|
|
<a class="page-link" href="#"
|
|
|
onclick={ () => onPageChanged(i) }>{ i + 1 }</a>
|
|
|
|
|
|
|
|
|
onclick={ e => { e.preventDefault(); onPageChanged(i); } }>{ i + 1 }</a>
|
|
|
</li>
|
|
|
</li>
|
|
|
));
|
|
|
));
|
|
|
}
|
|
|
}
|
|
@@ -50,7 +50,7 @@ class WBPagination extends Component { |
|
|
res.push((
|
|
|
res.push((
|
|
|
<li class={ activePage >= numPages - 1 ? "page-item disabled" : "page-item" }>
|
|
|
<li class={ activePage >= numPages - 1 ? "page-item disabled" : "page-item" }>
|
|
|
<a class="page-link" href="#"
|
|
|
<a class="page-link" href="#"
|
|
|
onclick={ () => onPageChanged(activePage + 1) }>Next</a>
|
|
|
|
|
|
|
|
|
onclick={ e => { e.preventDefault(); onPageChanged(activePage + 1); } }>Next</a>
|
|
|
</li>
|
|
|
</li>
|
|
|
));
|
|
|
));
|
|
|
|
|
|
|
|
|