2872: Use data chooser for running pipelines. Many presentation fixes.
[arvados.git] / apps / workbench / app / assets / javascripts / folders.js
index 10695cf15874b6676ab1f9526a0cafbfb1153fc3..ff1c7b86b27a709d30509b818d35a4d5f54e9042 100644 (file)
@@ -1,12 +1,20 @@
 $(document).
-    on('ready ajax:complete', function() {
-        $("[data-toggle='x-editable']").click(function(e) {
-            e.stopPropagation();
-            $($(this).attr('data-toggle-selector')).editable('toggle');
-        });
-    }).on('paste keyup change', 'input.search-folder-contents', function() {
+    on('paste keyup change', 'input.search-folder-contents', function() {
         var q = new RegExp($(this).val(), 'i');
         $(this).closest('div.panel').find('tbody tr').each(function() {
             $(this).toggle(!!$(this).text().match(q));
         });
+    }).on('change', 'select[data-filter-rows-by]', function() {
+        var val = $(this).val();
+        var filterby = $(this).attr('data-filter-rows-by');
+        var $target = $($(this).attr('data-filter-in'));
+        if (val == '') {
+            $target.find('.filterable').show();
+        } else {
+            $target.find('.filterable').hide();
+            console.log('.filterable[' + filterby + '="' + val + '"]');
+            $.each(val.split(" "), function(i, e) {
+                $target.find('.filterable['+filterby+'="'+e+'"]').show();
+            });
+        }
     });