From 82c9e29116729ab27578a80ffb306abe107c0088 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 12 Oct 2016 15:53:54 +0000 Subject: Bug 1305457 - product and component quick search does not work from describecomponents.cgi gives error if not logged in --- extensions/ProdCompSearch/web/js/prod_comp_search.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'extensions/ProdCompSearch') diff --git a/extensions/ProdCompSearch/web/js/prod_comp_search.js b/extensions/ProdCompSearch/web/js/prod_comp_search.js index efbaab81b..1b7e396a8 100644 --- a/extensions/ProdCompSearch/web/js/prod_comp_search.js +++ b/extensions/ProdCompSearch/web/js/prod_comp_search.js @@ -59,14 +59,17 @@ $(function() { $('.prod_comp_search') .each(function() { var that = $(this); + var params = { + limit: (that.data('max_results') + 1) + }; + if (BUGZILLA.api_token) { + params.Bugzilla_api_token = BUGZILLA.api_token; + } that.devbridgeAutocomplete({ serviceUrl: function(query) { return 'rest/prod_comp_search/' + encodeURIComponent(query); }, - params: { - Bugzilla_api_token: (BUGZILLA.api_token ? BUGZILLA.api_token : ''), - limit: (that.data('max_results') + 1) - }, + params: params, deferRequestBy: 250, minChars: 3, maxHeight: 500, -- cgit v1.2.3-24-g4f1b