Skip to content

Instantly share code, notes, and snippets.

@ig0r74
Last active May 25, 2023 09:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ig0r74/f37b210ceecefd3fcf9c4e36eba20e2f to your computer and use it in GitHub Desktop.
Save ig0r74/f37b210ceecefd3fcf9c4e36eba20e2f to your computer and use it in GitHub Desktop.
MODX mFilter2 одновременное использование стандартной пагинации и подгрузки кнопкой
$('.btn_more_custom').click(function() {
var href = $('.mse2_pagination .page-item.active').next('.page-item').find('.page-link').attr('href');
if (typeof href !== "undefined") {
mSearch2.addPage();
}
});
$(document).on('mse2_load', function(e, data) {
if (typeof $('.mse2_pagination .page-item.active').next('.page-item').next('.page-item').find('.page-link').attr('href') === "undefined") {
$('.btn_more_custom').hide();
} else {
$('.btn_more_custom').show();
}
});
// добавить кнопку под результатами
<button class="btn btn-default btn_more_custom">Загрузить еще</button>
<div class="mse2_pagination">
{'page.nav' | placeholder}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment