4088: use filterable.js to filter on client side
[arvados.git] / apps / workbench / app / assets / javascripts / selection.js.erb
index 535708089efa45e46a1670f7254e85803af84136..ca4dce3d9bf373f2e93949cbfb27f818d78318ae 100644 (file)
@@ -57,10 +57,6 @@ 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>';
-            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>'
-                + '<li class="notification"><table style="width: 100%"></table></li>';
             $('#selection-form-content').html(html);
 
             for (var i = 0; i < lst.length; i++) {
@@ -187,7 +183,7 @@ function dispatch_selection_action() {
     }
     $(this).
         closest('.selection-action-container').
-        find(':checkbox:checked').
+        find(':checkbox:checked:visible').
         each(function() {
             data.push({name: param_name, value: $(this).val()});
         });
@@ -219,6 +215,11 @@ function enable_disable_selection_actions() {
                         ($checked.filter('[value*=-j7d0g-]').length > 0) ||
                         ($checked.length < 1));
     <% end %>
+    $('[data-selection-action=combine-project-contents]').
+        closest('li').
+        toggleClass('disabled',
+                    ($checked.filter('[value*=-4zz18-]').length < 1) ||
+                    ($checked.length != $checked.filter('[value*=-4zz18-]').length));
 }
 
 $(document).