diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2018-01-17 23:09:13 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2018-01-17 23:09:13 +0300 |
commit | 5e15494ebcadd7726a4727d00b4d441a8c03a6aa (patch) | |
tree | d955c0a9b8ab497864cb6e7fd5a3eb8f95c2c3e9 | |
parent | cb5bd0652ff4e1a73a0c47ba3d011501c11156c2 (diff) |
on search result, request not in meta anymorev0.5.1
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | js/fulltextsearch.v1.navigation.js | 18 | ||||
-rw-r--r-- | js/fulltextsearch.v1.result.js | 6 | ||||
-rw-r--r-- | lib/Model/SearchResult.php | 3 |
3 files changed, 13 insertions, 14 deletions
diff --git a/js/fulltextsearch.v1.navigation.js b/js/fulltextsearch.v1.navigation.js index b3e2d4e..06d5b16 100644 --- a/js/fulltextsearch.v1.navigation.js +++ b/js/fulltextsearch.v1.navigation.js @@ -64,29 +64,29 @@ var nav = { }, - manageDivProviderNavigation: function (divProviderNavigation, meta) { + manageDivProviderNavigation: function (divProviderNavigation, request, meta) { - var maxPage = Math.ceil(meta.total / meta.request.size); + var maxPage = Math.ceil(meta.total / request.size); divProviderNavigation.attr('data-time', meta.time); - divProviderNavigation.attr('data-page', meta.request.page); - divProviderNavigation.attr('data-search', meta.request.search); + divProviderNavigation.attr('data-page', request.page); + divProviderNavigation.attr('data-search', request.search); divProviderNavigation.attr('data-max-page', maxPage); - divProviderNavigation.attr('data-size', meta.request.size); + divProviderNavigation.attr('data-size', request.size); divProviderNavigation.attr('data-total', meta.total); var providerName = divProviderNavigation.attr('data-provider-name'); - var left = "Search " + providerName + " for '" + meta.request.search + "' returned " + + var left = "Search " + providerName + " for '" + request.search + "' returned " + meta.total + " results in " + meta.time + "ms"; divProviderNavigation.find('.provider_navigation_left').text(left); - divProviderNavigation.find('.provider_navigation_curr').text(meta.request.page + ' / ' + + divProviderNavigation.find('.provider_navigation_curr').text(request.page + ' / ' + maxPage); divProviderNavigation.find('.provider_navigation_prev').stop().fadeTo(200, - (meta.request.page > 1) ? 1 : 0); + (request.page > 1) ? 1 : 0); divProviderNavigation.find('.provider_navigation_next').stop().fadeTo(200, - (meta.request.page < maxPage) ? 1 : 0); + (request.page < maxPage) ? 1 : 0); }, diff --git a/js/fulltextsearch.v1.result.js b/js/fulltextsearch.v1.result.js index 80a19f5..b6bcd88 100644 --- a/js/fulltextsearch.v1.result.js +++ b/js/fulltextsearch.v1.result.js @@ -45,7 +45,7 @@ var result = { } for (var i = 0; i < searchResult.length; i++) { - result.displayProviderResult(searchResult[i]); + result.displayProviderResult(res.request, searchResult[i]); } }, @@ -58,14 +58,14 @@ var result = { }, - displayProviderResult: function (result) { + displayProviderResult: function (request, result) { settings.divNoResult.fadeTo(settings.delay_result, 0); var current = curr.getProviderResult(result.provider.id); var divProvider = nav.getDivProvider(result.provider.id, result.provider.name); - nav.manageDivProviderNavigation(divProvider.children('.provider_navigation'), result.meta); + nav.manageDivProviderNavigation(divProvider.children('.provider_navigation'), request, result.meta); nav.manageDivProviderResult(divProvider.children('.provider_result'), result.documents, current.documents); diff --git a/lib/Model/SearchResult.php b/lib/Model/SearchResult.php index b364123..c070187 100644 --- a/lib/Model/SearchResult.php +++ b/lib/Model/SearchResult.php @@ -220,8 +220,7 @@ class SearchResult implements \JsonSerializable { 'time' => $this->getTime(), 'count' => $this->getCount(), 'total' => $this->getTotal(), - 'maxScore' => $this->getMaxScore(), - 'request' => $this->getRequest() + 'maxScore' => $this->getMaxScore() ] ]; } |