X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f26cbf1c4d949d3e7c7b26ab27c5f4d48d8059ed..9e0031c0bf48acdb76118ee643290d97a94926de:/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 fc11e64424..8d8292cb74 100644 --- a/apps/workbench/app/views/pipeline_instances/show.js.erb +++ b/apps/workbench/app/views/pipeline_instances/show.js.erb @@ -1,4 +1,16 @@ <% 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); +var selected_tab_hrefs = []; +if ($('div.body-content').html() != new_content) { + $('.nav-tabs li.active a').each(function() { + selected_tab_hrefs.push($(this).attr('href')); + }); + + $('div.body-content').html(new_content); + + // Show the same tabs that were active before we rewrote body-content + $.each(selected_tab_hrefs, function(i, href) { + $('.nav-tabs li a[href="' + href + '"]').tab('show'); + }); +} +$(document).trigger('ajax:complete');