Mobile compatibility for pagination
This commit is contained in:
parent
6f154234b3
commit
e7107c20b9
@ -510,13 +510,23 @@ jQuery(document).ready(function($)
|
|||||||
|
|
||||||
|
|
||||||
// pagination
|
// 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 currentPage = 0;
|
||||||
var previousArray = []
|
var previousArray = []
|
||||||
var options =
|
var options =
|
||||||
{
|
{
|
||||||
dataSource: paintingList,
|
dataSource: paintingList,
|
||||||
pageSize: pageSize,
|
pageSize: pageSize,
|
||||||
pageRange: 6,
|
pageRange: getPageRange(),
|
||||||
className: 'paginationjs-theme-ginou',
|
className: 'paginationjs-theme-ginou',
|
||||||
callback: function (response, pagination)
|
callback: function (response, pagination)
|
||||||
{
|
{
|
||||||
|
@ -38,13 +38,23 @@ jQuery(document).ready(function($)
|
|||||||
if (urlParams.get('page') != "")
|
if (urlParams.get('page') != "")
|
||||||
targetPage = 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 currentPage = 0;
|
||||||
var previousArray = []
|
var previousArray = []
|
||||||
var options =
|
var options =
|
||||||
{
|
{
|
||||||
dataSource: paintingList,
|
dataSource: paintingList,
|
||||||
pageSize: pageSize,
|
pageSize: pageSize,
|
||||||
pageRange: null,
|
pageRange: getPageRange(),
|
||||||
className: 'paginationjs-theme-ginou',
|
className: 'paginationjs-theme-ginou',
|
||||||
callback: function (response, pagination)
|
callback: function (response, pagination)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user