|
|
|
|
@ -32,7 +32,7 @@ $(document).ready(function () { |
|
|
|
|
|
|
|
|
|
// Обработчик кнопки "Подгрузить еще"
|
|
|
|
|
$('.courses').on('click', 'button.load__btn', function () { |
|
|
|
|
page = $(this).attr('data-next-page'); |
|
|
|
|
page++; |
|
|
|
|
loadCourses(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@ -116,13 +116,13 @@ $(document).ready(function () { |
|
|
|
|
$('.courses__list').css('opacity', '0.9'); |
|
|
|
|
const buttonElement = $('.courses').find('button.load__btn'); |
|
|
|
|
let coursesUrl = window.LIL_STORE.urls.courses + '?' + $.param({ |
|
|
|
|
category: category, |
|
|
|
|
age: age, |
|
|
|
|
category, |
|
|
|
|
age, |
|
|
|
|
}); |
|
|
|
|
if (page > 1) { |
|
|
|
|
buttonElement.addClass('loading'); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
if(replaceHistory){ |
|
|
|
|
history.replace(coursesUrl); |
|
|
|
|
} |
|
|
|
|
coursesUrl += `&page=${page}`; |
|
|
|
|
@ -137,7 +137,6 @@ $(document).ready(function () { |
|
|
|
|
$('.courses__list').html(data.content); |
|
|
|
|
} |
|
|
|
|
if (data.next_url) { |
|
|
|
|
buttonElement.attr('data-next-page-url', data.next_url); |
|
|
|
|
buttonElement.show(); |
|
|
|
|
} else { |
|
|
|
|
buttonElement.hide() |
|
|
|
|
|