[ARVADOS] updated: 41f3eef92c138cae45e8db12e385eaca8dc85941
git at public.curoverse.com
git at public.curoverse.com
Mon Jun 30 15:12:33 EDT 2014
Summary of changes:
.../app/assets/javascripts/infinite_scroll.js | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
via 41f3eef92c138cae45e8db12e385eaca8dc85941 (commit)
from 289a84cacdb0d3c9ab1d9876610af5ca6c224a88 (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 41f3eef92c138cae45e8db12e385eaca8dc85941
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Jun 30 15:10:47 2014 -0400
3099: Use appropriate tr>td markup if infinite scroll container is a table.
Remove unused class.
diff --git a/apps/workbench/app/assets/javascripts/infinite_scroll.js b/apps/workbench/app/assets/javascripts/infinite_scroll.js
index 44584d9..d968fe2 100644
--- a/apps/workbench/app/assets/javascripts/infinite_scroll.js
+++ b/apps/workbench/app/assets/javascripts/infinite_scroll.js
@@ -3,6 +3,7 @@ function maybe_load_more_content() {
var container; // element that receives new content
var src; // url for retrieving content
var scrollHeight;
+ var spinner, colspan;
scrollHeight = scroller.scrollHeight || $('body')[0].scrollHeight;
if ($(scroller).scrollTop() + $(scroller).height()
>
@@ -14,12 +15,27 @@ function maybe_load_more_content() {
return;
// Don't start another request until this one finishes
$(container).attr('data-infinite-content-href', null);
- $(container).append('<div class="spinner spinner-32px spinner-h-center infinite-scroller-spinner"></div>');
+ 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').
+ find('tr').eq(0).find('td,th').length;
+ if (colspan == 0)
+ colspan = '*';
+ spinner = ('<tr class="spinner"><td colspan="' + colspan + '">' +
+ spinner +
+ '</td></tr>');
+ }
+ $(container).append(spinner);
$.ajax(src,
{dataType: 'json',
type: 'GET',
data: {},
context: {container: container, src: src}}).
+ always(function() {
+ $(this.container).find(".spinner").detach();
+ }).
fail(function(jqxhr, status, error) {
if (jqxhr.readyState == 0 || jqxhr.status == 0) {
message = "Cancelled."
@@ -33,7 +49,6 @@ function maybe_load_more_content() {
$(this.container).attr('data-infinite-content-href', this.src);
}).
done(function(data, status, jqxhr) {
- $(this.container).find(".spinner").detach();
$(this.container).append(data.content);
$(this.container).attr('data-infinite-content-href', data.next_page_href);
});
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list