fix: change event name so it doesnt trigger complete event

add data to complete event
v1.18.x
Barış Soner Uşaklı 5 years ago
parent 842b8abb84
commit 7786187e84

@ -36,7 +36,7 @@ define('search', ['navigator', 'translator', 'storage'], function (nav, translat
Search.quick = function (query, options, callback) {
callback = callback || function () {};
var template = options.template || 'partials/quick-search-results';
$(window).trigger('action:search.quick', { data: query });
$(window).trigger('action:search.quick.start', { data: query });
query.searchOnly = 1;
Search.api(query, function (data) {
if (options.hideOnNoMatches && !data.posts.length) {
@ -52,7 +52,7 @@ define('search', ['navigator', 'translator', 'storage'], function (nav, translat
} else {
options.resultEl.addClass('hidden').find('#quick-search-results-container').html('');
}
$(window).trigger('action:search.quick.complete', { });
$(window).trigger('action:search.quick.complete', { data: data });
callback();
});
});

Loading…
Cancel
Save