2872: Add "move to project" button, fix "copy to project" behavior
[arvados.git] / apps / workbench / app / assets / javascripts / selection.js
index 84d65cda2d84419c20d5bf6b00a96773aaae9680..0fa2e9a0729bf90e9a2759d0c992fd5bf00fc5a7 100644 (file)
@@ -57,8 +57,10 @@ jQuery(function($){
         $("#persistent-selection-count").text(lst.length);
         if (lst.length > 0) {
             html = '<li><a href="#" class="btn btn-xs btn-info" id="clear_selections_button"><i class="fa fa-fw fa-ban"></i> Clear selections</a></li>';
-            if (this_object_uuid.match('-j7d0g-'))
-                html += '<li><button class="btn btn-xs btn-info" type="submit" name="copy_selections_into_project" id="copy_selections_into_project"><i class="fa fa-fw fa-folder-open"></i> Copy selections into this project</button></li>';
+            if (this_object_uuid.match('-j7d0g-')) {
+                html += '<li><button class="btn btn-xs btn-info" type="submit" name="copy_selections_into_project" id="copy_selections_into_project"><i class="fa fa-fw fa-copy"></i> Copy selections into this project</button></li>';
+                html += '<li><button class="btn btn-xs btn-info" type="submit" name="move_selections_into_project" id="move_selections_into_project"><i class="fa fa-fw fa-truck"></i> Move selections into this project</button></li>';
+           }
             html += '<li><button class="btn btn-xs btn-info" type="submit" name="combine_selected_files_into_collection" '
                 + ' id="combine_selected_files_into_collection">'
                 + '<i class="fa fa-fw fa-archive"></i> Combine selected collections and files into a new collection</button></li>'
@@ -200,8 +202,8 @@ function enable_disable_selection_actions() {
     var $checked = $('.persistent-selection:checkbox:checked');
     $('[data-selection-action]').
         closest('div.btn-group-sm').
-        find('*').
-        prop('disabled', ($checked.length == 0));
+        find('ul li').
+        toggleClass('disabled', ($checked.length == 0));
     $('[data-selection-action=compare]').
         closest('li').
         toggleClass('disabled',