Merge branch 'master' into 12033-multisite-search
[arvados.git] / apps / workbench / app / assets / javascripts / filterable.js
index 34075ca56c3c0f684a353f72b1bbbd9a480ced66..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,
 function updateFilterableQueryNow($target) {
     var newquery = $target.data('filterable-query-new');
     var params = $target.data('infinite-content-params-filterable') || {};
-    params.filters = [['any', 'ilike', '%' + newquery + '%']];
+    if (newquery == null || newquery == '') {
+      params.filters = [];
+    } else {
+      params.filters = [['any', '@@', newquery.trim().concat(':*')]];
+    }
+    $(".modal-dialog-preview-pane").html("");
     $target.data('infinite-content-params-filterable', params);
     $target.data('filterable-query', newquery);
 }