X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/45bbd49852b4fbd5a6d69122bd4c620c7c9e4674..e20590d485505f58f7745d74a311ca539c9be940:/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..28a1fdbf6e 100644 --- a/apps/workbench/app/views/pipeline_instances/show.js.erb +++ b/apps/workbench/app/views/pipeline_instances/show.js.erb @@ -1,4 +1,19 @@ +<%# Copyright (C) The Arvados Authors. All rights reserved. + +SPDX-License-Identifier: AGPL-3.0 %> + <% 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#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'); + }); +}