Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / assets / javascripts / work_unit_component.js
index 6c8374bd5a908550fead9824766e81b6072fd805..a84a2e71b82301a3ee39ed6a7be0632f899fe0ca 100644 (file)
@@ -1,17 +1,20 @@
-$(document).
-    on('click', '.component-detail-panel', function(event) {
-      var href = $($(event.target).attr('href'));
-      if ($(href).attr("class").split(' ').indexOf("in") == -1) {
-        return;   // collapsed; nothing more to do
-      }
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
 
+$(document).
+  on('click', '.component-detail-panel', function(event) {
+    var href = $($(event.target).attr('href'));
+    if ($(href).hasClass("in")) {
       var content_div = href.find('.work-unit-component-detail-body');
+      content_div.html('<div class="spinner spinner-32px col-sm-1"></div>');
       var content_url = href.attr('content-url');
       var action_data = href.attr('action-data');
       $.ajax(content_url, {dataType: 'html', type: 'POST', data: {action_data: action_data}}).
-          done(function(data, status, jqxhr) {
-              content_div.html(data);
-          }).fail(function(jqxhr, status, error) {
-              content_div.html(error);
-          });
-      });
+        done(function(data, status, jqxhr) {
+          content_div.html(data);
+        }).fail(function(jqxhr, status, error) {
+          content_div.html(error);
+        });
+    }
+  });