diff --git a/public/views/search-software-catalog.js b/public/views/search-software-catalog.js index a9fe121..cb3bd01 100644 --- a/public/views/search-software-catalog.js +++ b/public/views/search-software-catalog.js @@ -134,7 +134,10 @@ modulejs.define('SearchSoftwareCatalog', ['jquery', 'NoosferoRoot', 'SoftwareCat var timer = null; $("#search-input").keyup(function() { - timer = setTimeout(update_page_by_text_filter, 400); + // Only start the search(with ajax) after 3 characters + if(this.value.length >= 3) { + timer = setTimeout(update_page_by_text_filter, 400); + } }).keydown(function() { clearTimeout(timer); }); diff --git a/views/search/_software_search_form.html.erb b/views/search/_software_search_form.html.erb index 7c4f705..8647b88 100644 --- a/views/search/_software_search_form.html.erb +++ b/views/search/_software_search_form.html.erb @@ -11,7 +11,7 @@
- <%= text_field_tag 'query', @query, :id => 'search-input', :size => 50, :placeholder=>_("Type words about the software_info you're looking for") %> + <%= text_field_tag 'query', @query, :id => 'search-input', :size => 50, :placeholder=>_("Type words about the software_info you're looking for (the search begins after 3 characters)") %> <%= submit_button(:search, _('Filter')) %> -- libgit2 0.21.2