[ARVADOS] updated: 6702cdabbecef52d342c6f8c67c22cd15377165c
git at public.curoverse.com
git at public.curoverse.com
Mon May 18 13:36:47 EDT 2015
Summary of changes:
apps/workbench/app/assets/javascripts/tab_panes.js | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
via 6702cdabbecef52d342c6f8c67c22cd15377165c (commit)
from d14dd75b263d8f999603b66d23f74667d36a2412 (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 6702cdabbecef52d342c6f8c67c22cd15377165c
Author: Tom Clegg <tom at curoverse.com>
Date: Mon May 18 13:36:27 2015 -0400
5720: Leave existing content in place (and schedule another reload) if a tab-refresh gets cancelled.
diff --git a/apps/workbench/app/assets/javascripts/tab_panes.js b/apps/workbench/app/assets/javascripts/tab_panes.js
index eb57479..ddc5576 100644
--- a/apps/workbench/app/assets/javascripts/tab_panes.js
+++ b/apps/workbench/app/assets/javascripts/tab_panes.js
@@ -134,7 +134,21 @@ $(document).on('arv:pane:reload', '[data-pane-content-url]', function(e) {
var errhtml;
var contentType = jqxhr.getResponseHeader('Content-Type');
if (jqxhr.readyState == 0 || jqxhr.status == 0) {
- errhtml = "Cancelled.";
+ if ($pane.attr('data-loaded-at') > 0) {
+ // Stale content is already present. Leave it
+ // there while loading the next page.
+ $pane.removeClass('pane-loading');
+ $pane.addClass('pane-loaded');
+ // ...but schedule another refresh (after a
+ // throttle delay) in case the act of navigating
+ // away gets cancelled itself, leaving this page
+ // with content that we know is stale.
+ $pane.addClass('pane-stale');
+ $pane.attr('data-loaded-at', (new Date()).getTime());
+ $pane.trigger('arv:pane:reload');
+ return;
+ }
+ errhtml = "Cancelled.";
} else if (contentType && contentType.match(/\btext\/html\b/)) {
var $response = $(jqxhr.responseText);
var $wrapper = $('div#page-wrapper', $response);
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list