X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7a98271d94163cdc4afa5bfcf275db353bc062d2..7fb83a3380e62721801a4980c48ba78208c7b2e2:/apps/workbench/app/assets/javascripts/selection.js diff --git a/apps/workbench/app/assets/javascripts/selection.js b/apps/workbench/app/assets/javascripts/selection.js index 9213b70a71..f8dbed59c4 100644 --- a/apps/workbench/app/assets/javascripts/selection.js +++ b/apps/workbench/app/assets/javascripts/selection.js @@ -49,15 +49,21 @@ jQuery(function($){ } var update_count = function(e) { + var html; + var this_object_uuid = $('#selection-form-content'). + closest('form'). + find('input[name=uuid]').val(); var lst = get_selection_list(); $("#persistent-selection-count").text(lst.length); if (lst.length > 0) { - $('#selection-form-content').html( - '
  • Clear selections
  • ' - + '
  • ' - + '
  • '); + html = '
  • Clear selections
  • '; + if (this_object_uuid.match('-j7d0g-')) + html += '
  • '; + html += '
  • ' + + '
  • '; + $('#selection-form-content').html(html); for (var i = 0; i < lst.length; i++) { $('#selection-form-content > li > table').append("" @@ -91,7 +97,7 @@ jQuery(function($){ checkboxes[i].checked = false; } } - + $('.remove-selection').on('click', remove_selection_click); $('#clear_selections_button').on('click', clear_selections); }; @@ -100,7 +106,7 @@ jQuery(function($){ on('change', '.persistent-selection:checkbox', function(e) { //console.log($(this)); //console.log($(this).val()); - + var inc = 0; if ($(this).is(":checked")) { add_selection($(this).val(), $(this).attr('friendly_name'), $(this).attr('href'), $(this).attr('friendly_type')); @@ -148,7 +154,10 @@ select_form_sources = null; for (var i = 0; i < lst.length; i++) { if (lst[i].type == type) { - ret.push({text: lst[i].name, value: lst[i].uuid}) + var n = lst[i].name; + n = n.replace(/]*>/i, "["); + n = n.replace(/<\/span>/i, "]"); + ret.push({text: n, value: lst[i].uuid}) } } } @@ -169,4 +178,3 @@ select_form_sources = null; return ret; }; })(); -