Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions misc/largetest
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# 1e95cb88cbb2 2m13s 2m40s 34s Pagination part 2/UI support
# 035a8ce55604 2m12s 2m38s 34s Remove defaultWriter
# af1e4527e1ab 2m20s 2m36s 33s Remove shared* files
# 4ef52aea3e73 2m6s 2m33s 34s Remove lowerxid index/col

set -e

Expand Down
12 changes: 8 additions & 4 deletions registry/http/ui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7300,24 +7300,28 @@ function paginationBarHtml(itemCount) {
}
var countText = parts.join(' \u00b7 ');

function btn(rel, pairShown, icon, title) {
function btn(rel, pairShown, icon, title, atEnd) {
if (!pairShown) return '';
var has = !!_lastPageLinks[rel];
var has = !!_lastPageLinks[rel] && !atEnd;
return '<button class="cfg-btn eg-page-nav-btn" title="' + esc(title) + '"'
+ (has ? ' onclick="navigateToPage(\'' + rel + '\')"' : ' disabled')
+ '>' + icon + '</button>';
}

// First/Last are disabled on the first/last page (no prev/next), even if
// the server returned those links, since they'd be no-ops there.
var showFirstLast = !!(_lastPageLinks.first || _lastPageLinks.last);
var onFirstPage = !_lastPageLinks.prev;
var onLastPage = !_lastPageLinks.next;
var showPrevNext = !!(_lastPageLinks.prev || _lastPageLinks.next);

return '<span class="eg-pagination-bar">'
+ '<span class="eg-pagination-count">' + esc(countText) + '</span>'
+ '<span class="eg-pagination-buttons">'
+ btn('first', showFirstLast, _pageFirstIconSVG, 'First')
+ btn('first', showFirstLast, _pageFirstIconSVG, 'First', onFirstPage)
+ btn('prev', showPrevNext, _pagePrevIconSVG, 'Prev')
+ btn('next', showPrevNext, _pageNextIconSVG, 'Next')
+ btn('last', showFirstLast, _pageLastIconSVG, 'Last')
+ btn('last', showFirstLast, _pageLastIconSVG, 'Last', onLastPage)
+ '</span>'
+ '</span>';
}
Expand Down
Loading