Make ellipsis in pagination clickable.
It will set focus to the jump to page input, and "select" its value.
Allowing user to simply type in any numbers and press Enter to navigate.

Bumped v1 version string.
This commit is contained in:
Bobby Wibowo 2019-08-27 05:23:54 +07:00
parent dcc393e7e0
commit b77d4b7c65
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
3 changed files with 16 additions and 3 deletions

View File

@ -82,6 +82,10 @@ a.pagination-link.is-current:hover {
border-color: #60a8dc;
}
li[data-action="page-ellipsis"] {
cursor: pointer;
}
.label {
color: #bdc3c7;
}

View File

@ -270,6 +270,8 @@ page.domClick = function (event) {
return page.filterUploads(element)
case 'view-user-uploads':
return page.viewUserUploads(id)
case 'page-ellipsis':
return page.focusJumpToPage()
case 'page-prev':
case 'page-next':
case 'page-goto':
@ -329,6 +331,13 @@ page.switchPage = function (action, element) {
}
}
page.focusJumpToPage = function () {
const element = document.querySelector('#jumpToPage')
if (!element) return
element.focus()
element.select()
}
page.getUploads = function ({ pageNum, album, all, filters, scroll } = {}, element) {
if (element) page.isLoading(element, true)
@ -2004,12 +2013,12 @@ page.paginate = function (totalItems, itemsPerPage, currentPage) {
startDots () {
template += `
<li><a class="button pagination-link" aria-label="Goto page 1" data-action="page-goto" data-goto="0">1</a></li>
<li><span class="pagination-ellipsis">&hellip;</span></li>
<li data-action="page-ellipsis"><span class="pagination-ellipsis">&hellip;</span></li>
`
},
endDots () {
template += `
<li><span class="pagination-ellipsis">&hellip;</span></li>
<li data-action="page-ellipsis"><span class="pagination-ellipsis">&hellip;</span></li>
<li><a class="button pagination-link" aria-label="Goto page ${numPages}" data-action="page-goto" data-goto="${numPages - 1}">${numPages}</a></li>
`
}

View File

@ -16,7 +16,7 @@
v3: CSS and JS files (libs such as bulma, lazyload, etc).
v4: Renders in /public/render/* directories (to be used by render.js).
#}
{% set v1 = "MIxMXR8TwU" %}
{% set v1 = "UOoSqCmggh" %}
{% set v2 = "hiboQUzAzp" %}
{% set v3 = "f0nYw5J15T" %}
{% set v4 = "S3TAWpPeFS" %}