Skip to content

Commit ef4ce34

Browse files
authored
feat(search): onresults callback fromcache
The onResults callback was not firedwhen the results came from the cache. This is now implemented. The callback will retrieve an additional 2nd parameter which will indicate if the call was initiated from remote (false) or cache (true)
1 parent 11b4099 commit ef4ce34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/definitions/modules/search.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@
561561
if (cache) {
562562
module.debug('Reading result from cache', searchTerm);
563563
module.save.results(cache.results);
564+
settings.onResults.call(element, cache.results, true);
564565
module.addResults(cache.html);
565566
module.inject.id(cache.results);
566567
callback();
@@ -1345,7 +1346,7 @@
13451346
onResultsAdd: false,
13461347

13471348
onSearchQuery: function (query) {},
1348-
onResults: function (response) {},
1349+
onResults: function (response, fromCache) {},
13491350

13501351
onResultsOpen: function () {},
13511352
onResultsClose: function () {},

0 commit comments

Comments
 (0)