Browse Source

add img pagination support of infinite scroll

Noémi Ványi 8 years ago
parent
commit
420ef433ae
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      searx/static/plugins/js/infinite_scroll.js

+ 4
- 0
searx/static/plugins/js/infinite_scroll.js View File

@@ -4,9 +4,13 @@ $(document).ready(function() {
4 4
         if ($(document).height() - win.height() == win.scrollTop()) {
5 5
             var formData = $('#pagination form:last').serialize();
6 6
             if (formData) {
7
+                var pageno = $('#pagination input[name=pageno]:last').attr('value');
7 8
                 $('#pagination').html('<div class="loading-spinner"></div>');
8 9
                 $.post('./', formData, function (data) {
10
+                    var lastImageHref = $('.result-images:last a').attr('href');
9 11
                     var body = $(data);
12
+                    $('a[href^="#open-modal"]:last').attr('href', '#open-modal-1-' + pageno);
13
+                    body.find('.modal-image a:first').attr('href', lastImageHref);
10 14
                     $('#pagination').remove();
11 15
                     $('#main_results').append('<hr/>');
12 16
                     $('#main_results').append(body.find('.result'));