Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / app / assets / javascripts / filterable.js
index 27473ad28585a7d44504465299bfbb4cc4656916..938ad80b77ec3d8b1c08f9d79c98cc8fa9c64851 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
 // filterable.js shows/hides content when the user operates
 // search/select widgets. For "infinite scroll" content, it passes the
 // filters to the server and retrieves new content. For other content,
@@ -55,8 +59,9 @@ function updateFilterableQueryNow($target) {
     if (newquery == null || newquery == '') {
       params.filters = [];
     } else {
-      params.filters = [['any', '@@', newquery.concat(':*')]];
+      params.filters = [['any', '@@', newquery.trim().concat(':*')]];
     }
+    $(".modal-dialog-preview-pane").html("");
     $target.data('infinite-content-params-filterable', params);
     $target.data('filterable-query', newquery);
 }