Skip to content

Commit 2860239

Browse files
[O2B-1180] Add first&last pages links (#1452)
* [O2B-1180] Add first&last pages links * Fix ids
1 parent 4a651a6 commit 2860239

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

lib/public/components/Pagination/pageSelector.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* or submit itself to any jurisdiction.
1212
*/
1313

14-
import { h } from '/js/src/index.js';
14+
import { h, iconMediaStepBackward, iconMediaStepForward } from '/js/src/index.js';
1515
import { iconArrowThickLeft, iconArrowThickRight } from '/js/src/icons.js';
1616

1717
const MAX_VISIBLE_PAGES = 5;
@@ -51,6 +51,10 @@ const pageSelector = (currentPage, pagesCount, onPageChange) => {
5151
return h(
5252
'.btn-group#pageSelector',
5353
[
54+
h('button.btn.mh1#pageMoveFirst', {
55+
onclick: () => onPageChange(1),
56+
disabled: currentPage === 1,
57+
}, iconMediaStepBackward()),
5458
h('button.btn.mh1#pageMoveLeft', {
5559
onclick: () => onPageChange(currentPage - 1),
5660
disabled: currentPage === 1,
@@ -60,6 +64,10 @@ const pageSelector = (currentPage, pagesCount, onPageChange) => {
6064
onclick: () => onPageChange(currentPage + 1),
6165
disabled: currentPage === pagesCount,
6266
}, iconArrowThickRight()),
67+
h('button.btn.mh1#pageMoveLast', {
68+
onclick: () => onPageChange(pagesCount),
69+
disabled: currentPage === pagesCount,
70+
}, iconMediaStepForward()),
6371
],
6472
);
6573
};

0 commit comments

Comments
 (0)