mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Extra search options; only search after three chars have been entered.
This commit is contained in:
parent
c2ace9a0a0
commit
0551f27c83
1 changed files with 6 additions and 2 deletions
|
@ -63,8 +63,12 @@ define [
|
|||
$scope.$apply()
|
||||
|
||||
$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
|
||||
$scope.suggestions = [];
|
||||
|
||||
|
|
Loading…
Reference in a new issue