[ARVADOS] updated: cb832ae39672fe1721e3c531374bdbaa4f24161a

git at public.curoverse.com git at public.curoverse.com
Wed Jul 16 23:07:09 EDT 2014


Summary of changes:
 .../app/assets/javascripts/infinite_scroll.js      | 26 ++++++++++++++--------
 .../app/controllers/projects_controller.rb         |  2 +-
 2 files changed, 18 insertions(+), 10 deletions(-)

       via  cb832ae39672fe1721e3c531374bdbaa4f24161a (commit)
      from  8298d5a841ac106c408b2834dd73091405c2e180 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit cb832ae39672fe1721e3c531374bdbaa4f24161a
Author: radhika <radhika at curoverse.com>
Date:   Wed Jul 16 23:06:42 2014 -0400

    3140: infinite-scroller

diff --git a/apps/workbench/app/assets/javascripts/infinite_scroll.js b/apps/workbench/app/assets/javascripts/infinite_scroll.js
index a17b446..846f43c 100644
--- a/apps/workbench/app/assets/javascripts/infinite_scroll.js
+++ b/apps/workbench/app/assets/javascripts/infinite_scroll.js
@@ -5,21 +5,24 @@ function maybe_load_more_content() {
     var scrollHeight;
     var spinner, colspan;
     scrollHeight = scroller.scrollHeight || $('body')[0].scrollHeight;
+        var num_scrollers = $(window).data("arv-num-scrollers");
     if ($(scroller).scrollTop() + $(scroller).height()
         >
         scrollHeight - 50) {
-        container = $(this).data('infinite-container');
-        src = $(container).attr('data-infinite-content-href');
+
+        for (var i = 0; i < num_scrollers; i++) {
+        $container = $($(this).data('infinite-container'+i));
+        src = $container.attr('data-infinite-content-href');
         if (!src)
-            // Finished
-            return;
+          continue;
+
         // Don't start another request until this one finishes
-        $(container).attr('data-infinite-content-href', null);
+        $container.attr('data-infinite-content-href', null);
         spinner = '<div class="spinner spinner-32px spinner-h-center"></div>';
         if ($(container).is('table,tbody,thead,tfoot')) {
             // Hack to determine how many columns a new tr should have
             // in order to reach full width.
-            colspan = $(container).closest('table').
+            colspan = $container.closest('table').
                 find('tr').eq(0).find('td,th').length;
             if (colspan == 0)
                 colspan = '*';
@@ -27,12 +30,12 @@ function maybe_load_more_content() {
                        spinner +
                        '</td></tr>');
         }
-        $(container).append(spinner);
+        $container.append(spinner);
         $.ajax(src,
                {dataType: 'json',
                 type: 'GET',
                 data: {},
-                context: {container: container, src: src}}).
+                context: {container: $container, src: src}}).
             always(function() {
                 $(this.container).find(".spinner").detach();
             }).
@@ -52,10 +55,13 @@ function maybe_load_more_content() {
                 $(this.container).append(data.content);
                 $(this.container).attr('data-infinite-content-href', data.next_page_href);
             });
+        break;
+        }
     }
 }
 $(document).
     on('ready ajax:complete', function() {
+        var num_scrollers = 0;
         $('[data-infinite-scroller]').each(function() {
             var $scroller = $($(this).attr('data-infinite-scroller'));
             if (!$scroller.hasClass('smart-scroll') &&
@@ -63,7 +69,9 @@ $(document).
                 $scroller = $(window);
             $scroller.
                 addClass('infinite-scroller').
-                data('infinite-container', this).
+                data('infinite-container'+num_scrollers, this).
                 on('scroll', maybe_load_more_content);
+            num_scrollers++;
         });
+        $(window).data("arv-num-scrollers", num_scrollers);
     });
diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index 108cb60..6e62b5c 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -98,7 +98,7 @@ class ProjectsController < ApplicationController
                                         project: @object
                                       }),
             next_page_href: (next_page_offset and
-                             url_for(offset: next_page_offset, partial: true))
+                             url_for(offset: next_page_offset, filters: params[:filters], partial: true))
           }
         }
       end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list