From fabca195200bd227d5347d1dc1b47b3caee4fb4f Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Vilain Date: Fri, 9 Aug 2013 17:33:08 +0200 Subject: [PATCH] SONAR-3791 Allow users to search for projects by typing only 2 chars in the header search box --- .../src/main/webapp/WEB-INF/app/models/resource_index.rb | 2 +- sonar-server/src/main/webapp/javascripts/application.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/resource_index.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/resource_index.rb index 84ff6f3571e..242e7abacad 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/resource_index.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/resource_index.rb @@ -24,7 +24,7 @@ class ResourceIndex < ActiveRecord::Base belongs_to :resource, :class_name => 'Project', :foreign_key => 'resource_id' belongs_to :root_project, :class_name => 'Project', :foreign_key => 'root_project_id' - MIN_SEARCH_SIZE=3 + MIN_SEARCH_SIZE=2 def resource_id_for_authorization root_project_id diff --git a/sonar-server/src/main/webapp/javascripts/application.js b/sonar-server/src/main/webapp/javascripts/application.js index 857298a34da..3f687bde1a4 100644 --- a/sonar-server/src/main/webapp/javascripts/application.js +++ b/sonar-server/src/main/webapp/javascripts/application.js @@ -25,7 +25,7 @@ function autocompleteResources() { $('searchInput').value = ''; new Ajax.Autocompleter('searchInput', 'searchResourcesResults', baseUrl + '/search', { method: 'post', - minChars: 3, + minChars: 2, indicator: 'searchingResources', paramName: 's', updateElement: function (item) { -- 2.39.5