X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a2107d5fc7982769c2d667e51656a6e2529d9bc9..9126da70d57cdd32938c4b3814fedf2bd1f1db93:/apps/workbench/app/views/pipeline_instances/show.js.erb diff --git a/apps/workbench/app/views/pipeline_instances/show.js.erb b/apps/workbench/app/views/pipeline_instances/show.js.erb index cfe288d0e3..8ab1e8f68f 100644 --- a/apps/workbench/app/views/pipeline_instances/show.js.erb +++ b/apps/workbench/app/views/pipeline_instances/show.js.erb @@ -1,5 +1,15 @@ <% self.formats = [:html] %> var new_content = "<%= escape_javascript(render template: 'pipeline_instances/show') %>"; -if ($('div.body-content').html() != new_content) - $('div.body-content').html(new_content); -$(document).trigger('ajax:complete'); +var selected_tab_hrefs = []; +if ($('div#page-wrapper').html() != new_content) { + $('.nav-tabs li.active a').each(function() { + selected_tab_hrefs.push($(this).attr('href')); + }); + + $('div#page-wrapper').html(new_content); + + // Show the same tabs that were active before we rewrote page-wrapper + $.each(selected_tab_hrefs, function(i, href) { + $('.nav-tabs li a[href="' + href + '"]').tab('show'); + }); +}