mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #1939 from overleaf/jel-no-search-results
Show message when there are no learn wiki search results GitOrigin-RevId: cb1600baeb4a9860575385be78a825cb3942903a
This commit is contained in:
parent
a31090daab
commit
545b57d6be
2 changed files with 5 additions and 0 deletions
|
@ -28,3 +28,5 @@ mixin faq_search(headerText, headerClass)
|
|||
a(ng-href='{{hit.url}}',ng-repeat='hit in hits').search-result.card.card-thin
|
||||
span(ng-bind-html='hit.name')
|
||||
div.search-result-content(ng-show="hit.content != ''", ng-bind-html='hit.content')
|
||||
.row-spaced-small.search-result.card.card-thin(ng-if="!processingSearch && searchQueryText.length > 1 && hits.length === 0")
|
||||
p #{translate("no_search_results")}
|
|
@ -26,6 +26,7 @@ define(['base', 'directives/mathjax', 'services/algolia-search'], function(
|
|||
$scope.hits = []
|
||||
$scope.hits_total = 0
|
||||
$scope.config_hits_per_page = 20
|
||||
$scope.processingSearch = false
|
||||
|
||||
$scope.clearSearchText = function() {
|
||||
$scope.searchQueryText = ''
|
||||
|
@ -85,6 +86,7 @@ define(['base', 'directives/mathjax', 'services/algolia-search'], function(
|
|||
}
|
||||
|
||||
$scope.search = function() {
|
||||
$scope.processingSearch = true
|
||||
const query = $scope.searchQueryText
|
||||
if (query == null || query.length === 0) {
|
||||
updateHits([])
|
||||
|
@ -94,6 +96,7 @@ define(['base', 'directives/mathjax', 'services/algolia-search'], function(
|
|||
return algoliaSearch.searchWiki(
|
||||
query,
|
||||
function(err, response) {
|
||||
$scope.processingSearch = false
|
||||
if (response.hits.length === 0) {
|
||||
return updateHits([])
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue