searxng/searx/static/plugins/js/infinite_scroll.js
Noémi Ványi e8319fa2cb Revert "Merge pull request #793 from kvch/pics-modal"
This reverts commit bff41987a4, reversing
changes made to d08108be62.
2017-01-03 22:04:09 +01:00

18 lines
725 B
JavaScript

$(document).ready(function() {
var win = $(window);
win.scroll(function() {
if ($(document).height() - win.height() == win.scrollTop()) {
var formData = $('#pagination form:last').serialize();
if (formData) {
$('#pagination').html('<div class="loading-spinner"></div>');
$.post('./', formData, function (data) {
var body = $(data);
$('#pagination').remove();
$('#main_results').append('<hr/>');
$('#main_results').append(body.find('.result'));
$('#main_results').append(body.find('#pagination'));
});
}
}
});
});