Skip to content

Commit

Permalink
on search result, request not in meta anymore
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed Jan 17, 2018
1 parent cb5bd06 commit 5e15494
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
18 changes: 9 additions & 9 deletions js/fulltextsearch.v1.navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},


Expand Down
6 changes: 3 additions & 3 deletions js/fulltextsearch.v1.result.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var result = {
}

for (var i = 0; i < searchResult.length; i++) {
result.displayProviderResult(searchResult[i]);
result.displayProviderResult(res.request, searchResult[i]);
}
},

Expand All @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions lib/Model/SearchResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ public function jsonSerialize() {
'time' => $this->getTime(),
'count' => $this->getCount(),
'total' => $this->getTotal(),
'maxScore' => $this->getMaxScore(),
'request' => $this->getRequest()
'maxScore' => $this->getMaxScore()
]
];
}
Expand Down

0 comments on commit 5e15494

Please sign in to comment.