X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/28e0fb829175415c533ea783d90ade8a39bdb236..42c20b25e1325124b88e3b9b285544dc41122b56:/apps/workbench/app/assets/javascripts/work_unit_component.js diff --git a/apps/workbench/app/assets/javascripts/work_unit_component.js b/apps/workbench/app/assets/javascripts/work_unit_component.js index 6c8374bd5a..a84a2e71b8 100644 --- a/apps/workbench/app/assets/javascripts/work_unit_component.js +++ b/apps/workbench/app/assets/javascripts/work_unit_component.js @@ -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('
'); 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); + }); + } + });