diff options
author | Noémi Ványi <sitbackandwait@gmail.com> | 2016-12-28 12:39:20 +0100 |
---|---|---|
committer | Noémi Ványi <sitbackandwait@gmail.com> | 2016-12-29 23:40:23 +0100 |
commit | 420ef433ae9b58786a4d2cc3816aff1e38a7076e (patch) | |
tree | 77042f21c8b3f7026e83bdc4e9ccc5506a122cd6 /searx/static | |
parent | 2ec6034c8545290ac58f6b9868b266aa1befde2f (diff) | |
download | searxng-420ef433ae9b58786a4d2cc3816aff1e38a7076e.tar.gz searxng-420ef433ae9b58786a4d2cc3816aff1e38a7076e.zip |
add img pagination support of infinite scroll
Diffstat (limited to 'searx/static')
-rw-r--r-- | searx/static/plugins/js/infinite_scroll.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/searx/static/plugins/js/infinite_scroll.js b/searx/static/plugins/js/infinite_scroll.js index 9cd582d7f..1bc27e2e7 100644 --- a/searx/static/plugins/js/infinite_scroll.js +++ b/searx/static/plugins/js/infinite_scroll.js @@ -4,9 +4,13 @@ $(document).ready(function() { if ($(document).height() - win.height() == win.scrollTop()) { var formData = $('#pagination form:last').serialize(); if (formData) { + var pageno = $('#pagination input[name=pageno]:last').attr('value'); $('#pagination').html('<div class="loading-spinner"></div>'); $.post('./', formData, function (data) { + var lastImageHref = $('.result-images:last a').attr('href'); var body = $(data); + $('a[href^="#open-modal"]:last').attr('href', '#open-modal-1-' + pageno); + body.find('.modal-image a:first').attr('href', lastImageHref); $('#pagination').remove(); $('#main_results').append('<hr/>'); $('#main_results').append(body.find('.result')); |