';
$(gallery_tab).append(botPaginationHtml);
f_loadPageGallerySquares('1', gallery_tab);
}
}
}
}
function f_loadPageGallerySquares(pageNum, elm) {
if ($(elm).hasClass('pagination-parent')) {
elmId = $(elm).attr('id');
}
else {
elmId = $(elm).parents('.pagination-parent').attr('id');
}
var gallery_tab_selector = '#' + elmId;
$(gallery_tab_selector + ' .pagination-item').hide();
$(gallery_tab_selector + ' .pagination-item[data-page="' + pageNum + '"]').show();
if ($(gallery_tab_selector).hasClass('grid')) {
var $grid = $(gallery_tab_selector).masonry({
initLayout: true,
itemSelector: '.grid-item',
columnWidth: '.grid-sizer',
percentPosition: true
});
// bind event
$grid.masonry( 'on', 'layoutComplete', function() {
console.log('layout is complete');
});
// trigger initial layout
$grid.masonry();
}
$(gallery_tab_selector + ' .list-pagination-gallery li').removeClass('active-page');
$(gallery_tab_selector + ' .list-pagination-gallery li[data-page="' + pageNum + '"]').addClass('active-page');
$(gallery_tab_selector + ' .list-pagination-gallery li').show();
$(gallery_tab_selector + ' .list-pagination-gallery li').each(function (i, v) {
if (parseInt($(v).attr('data-page')) > (parseInt(pageNum) + 3) || parseInt($(v).attr('data-page')) 0)
f_loadPageGallerySquares(parseInt(currentPage) + 1, gallery_tab_selector);
}
function f_previousPageGallerySquares(elm) {
var gallery_tab_selector = '#' + $(elm).parents('.pagination-parent').attr('id');
var currentPage = $(gallery_tab_selector + ' .pagination-item:visible').first().attr('data-page');
if ($(gallery_tab_selector + ' .pagination-item[data-page="' + (parseInt(currentPage) - 1) + '"]').length > 0)
f_loadPageGallerySquares(parseInt(currentPage) - 1, gallery_tab_selector);
}
function f_resize() {
$('.gallerySquareContainer .img_wrapper img').css('min-height', 0);
if (nestedGalleryLocation == 'side' && $(window).width() 1)
$('.top-dropdown').removeClass('hide-dropdown');
if ($(window).width() > 1025 && nestedGalleryLocation != 'dropdown')
$('.top-dropdown').addClass('hide-dropdown');
if ($(window).width() minHeight)
minHeight = $(this).height();
});
$('.gallerySquareContainer .img_wrapper img').css('min-height', minHeight);
}