X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/acc7d4a40ae78e866c983624ec36b7bae3b918a9..c8d04b26dbeb3dd4401788053bf514b9f172a185:/apps/workbench/app/assets/javascripts/infinite_scroll.js diff --git a/apps/workbench/app/assets/javascripts/infinite_scroll.js b/apps/workbench/app/assets/javascripts/infinite_scroll.js index 6e467f5594..b89ac817cb 100644 --- a/apps/workbench/app/assets/javascripts/infinite_scroll.js +++ b/apps/workbench/app/assets/javascripts/infinite_scroll.js @@ -72,7 +72,7 @@ function maybe_load_more_content(event) { } $container.find(".spinner").detach(); $container.append(spinner); - $container.attr('data-infinite-serial', serial); + $container.data('data-infinite-serial', serial); if (src == $container.attr('data-infinite-content-href0')) { // If we're loading the first page, collect filters from @@ -103,12 +103,12 @@ function maybe_load_more_content(event) { fail(function(jqxhr, status, error) { var $faildiv; var $container = this.container; - if ($container.attr('data-infinite-serial') != this.serial) { + if ($container.data('data-infinite-serial') != this.serial) { // A newer request is already in progress. return; } if (jqxhr.readyState == 0 || jqxhr.status == 0) { - message = "Cancelled." + message = "Cancelled."; } else if (jqxhr.responseJSON && jqxhr.responseJSON.errors) { message = jqxhr.responseJSON.errors.join("; "); } else { @@ -123,13 +123,14 @@ function maybe_load_more_content(event) { $container.find('div.spinner').replaceWith($faildiv); }). done(function(data, status, jqxhr) { - if ($container.attr('data-infinite-serial') != this.serial) { + if ($container.data('data-infinite-serial') != this.serial) { // A newer request is already in progress. return; } $container.find(".spinner").detach(); $container.append(data.content); $container.attr('data-infinite-content-href', data.next_page_href); + ping_all_scrollers(); }); } } @@ -151,7 +152,8 @@ function mergeInfiniteContentParams($container) { // For example, filterable.js writes filters in // infiniteContentParamsFilterable ("search for text foo") // without worrying about clobbering the filters set up by the - // tab pane ("only show jobs and pipelines in this tab"). + // tab pane ("only show container requests and pipeline instances + // in this tab"). $.each($container.data(), function(datakey, datavalue) { // Note: We attach these data to DOM elements using // . We store/retrieve them