From: radhika Date: Thu, 6 Nov 2014 04:33:21 +0000 (-0500) Subject: 3177: restrict only one file selection in collection chooser; remove clippy; clear... X-Git-Tag: 1.1.0~1998^2~17 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/1c0e350af2a30f4627ad879545c9c6fc6554d92a 3177: restrict only one file selection in collection chooser; remove clippy; clear selections on load. --- diff --git a/apps/workbench/app/assets/javascripts/select_modal.js b/apps/workbench/app/assets/javascripts/select_modal.js index 36c145fc02..d84037763c 100644 --- a/apps/workbench/app/assets/javascripts/select_modal.js +++ b/apps/workbench/app/assets/javascripts/select_modal.js @@ -35,8 +35,14 @@ $(document).on('click', '.selectable', function() { }); } }).on('click', '.persistent-selection', function() { + var checked_status = this.checked; var $modal = $(this).closest('.modal'); $checked_selections = $modal.find('.persistent-selection:checked'); + + if (checked_status && ($checked_selections.length > 1)) { + $(this).prop('checked', false); + } + any = ($checked_selections.length > 0); $(this). closest('.modal'). diff --git a/apps/workbench/app/assets/javascripts/selection.js.erb b/apps/workbench/app/assets/javascripts/selection.js.erb index 59e6425698..38f3f4a83f 100644 --- a/apps/workbench/app/assets/javascripts/selection.js.erb +++ b/apps/workbench/app/assets/javascripts/selection.js.erb @@ -108,7 +108,8 @@ jQuery(function($){ } }); - $(window).on('load storage', update_count); + $(window).on('load', clear_selections); + $(window).on('storage', update_count); $('#selection-form-content').on("click", function(e) { e.stopPropagation(); diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb index 3fc0c92fcd..9e966e148a 100644 --- a/apps/workbench/app/views/layouts/body.html.erb +++ b/apps/workbench/app/views/layouts/body.html.erb @@ -67,19 +67,6 @@ - - <% if current_user.is_admin %>