X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/58997b4550660886fa4b402a4079267607380eda..60f89f0b235ac6b2729166e4bf4c04da3b9c1670:/apps/workbench/app/assets/javascripts/selection.js.erb diff --git a/apps/workbench/app/assets/javascripts/selection.js.erb b/apps/workbench/app/assets/javascripts/selection.js.erb index 5c69c50c11..e8f21eefd5 100644 --- a/apps/workbench/app/assets/javascripts/selection.js.erb +++ b/apps/workbench/app/assets/javascripts/selection.js.erb @@ -1,3 +1,7 @@ +<%# Copyright (C) The Arvados Authors. All rights reserved. + +SPDX-License-Identifier: AGPL-3.0 %> + //= require jquery //= require jquery_ujs @@ -53,6 +57,8 @@ function dispatch_selection_action() { function enable_disable_selection_actions() { var $container = $(this); var $checked = $('.persistent-selection:checkbox:checked', $container); + var collection_lock_classes = $('.lock-collection-btn').attr('class') + $('[data-selection-action]', $container). closest('div.btn-group-sm'). find('ul li'). @@ -74,6 +80,15 @@ function enable_disable_selection_actions() { toggleClass('disabled', ($checked.filter('[value*=-4zz18-]').length < 1) || ($checked.length != $checked.filter('[value*=-4zz18-]').length)); + $('[data-selection-action=remove-selected-files]', $container). + closest('li'). + toggleClass('disabled', + ($checked.length < 0) || + !($checked.length > 0 && collection_lock_classes && collection_lock_classes.indexOf("fa-unlock") !=-1)); + $('[data-selection-action=untrash-selected-items]', $container). + closest('li'). + toggleClass('disabled', + ($checked.length < 1)); } $(document).