Procházet zdrojové kódy

Extra search options; only search after three chars have been entered.

Paulo Reis před 10 roky
rodič
revize
0551f27c83
1 změnil soubory, kde provedl 6 přidání a 2 odebrání
  1. 6 2
      services/web/public/coffee/main/contact-us.coffee

+ 6 - 2
services/web/public/coffee/main/contact-us.coffee

@@ -63,8 +63,12 @@ define [
 				$scope.$apply()
 				$scope.$apply()
 
 
 		$scope.$watch "form.subject", (newVal, oldVal) ->
 		$scope.$watch "form.subject", (newVal, oldVal) ->
-			if newVal and newVal != oldVal
-				algoliaSearch.searchWiki newVal, _handleSearchResults, { hitsPerPage: 3 }
+			if newVal and newVal != oldVal and newVal.length > 3
+				# TODO Search the KB index instead; Wiki is used for testing purposes.
+				algoliaSearch.searchWiki newVal, _handleSearchResults, { 
+					hitsPerPage: 3
+					typoTolerance: 'strict'
+				}
 			else
 			else
 				$scope.suggestions = [];
 				$scope.suggestions = [];