Mobile compatibility for pagination

This commit is contained in:
Théo Marchal 2021-02-14 12:38:46 +01:00
parent 6f154234b3
commit e7107c20b9
2 changed files with 22 additions and 2 deletions

View File

@ -510,13 +510,23 @@ jQuery(document).ready(function($)
// pagination
function getPageRange()
{
if (window.innerWidth >= 600)
return 6;
else if (window.innerWidth < 600 && window.innerWidth > 450)
return 4;
else
return 2;
}
var currentPage = 0;
var previousArray = []
var options =
{
dataSource: paintingList,
pageSize: pageSize,
pageRange: 6,
pageRange: getPageRange(),
className: 'paginationjs-theme-ginou',
callback: function (response, pagination)
{

View File

@ -38,13 +38,23 @@ jQuery(document).ready(function($)
if (urlParams.get('page') != "")
targetPage = urlParams.get('page');
function getPageRange()
{
if (window.innerWidth >= 600)
return null;
else if (window.innerWidth < 600 && window.innerWidth > 450)
return 4;
else
return 2;
}
var currentPage = 0;
var previousArray = []
var options =
{
dataSource: paintingList,
pageSize: pageSize,
pageRange: null,
pageRange: getPageRange(),
className: 'paginationjs-theme-ginou',
callback: function (response, pagination)
{