Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / views / pipeline_instances / show.js.erb
index cfe288d0e322785294fce8bbcaaf8c4f144e268e..28a1fdbf6e476f0ff15f2642135948dacdfb3ff2 100644 (file)
@@ -1,5 +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);
-$(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');
+    });
+}