summaryrefslogtreecommitdiffstats
path: root/extensions/ProdCompSearch
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-10-12 17:53:54 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-10-12 17:53:54 +0200
commit82c9e29116729ab27578a80ffb306abe107c0088 (patch)
treeff9875bf77010f96c0d9fdf8c9b5f4db6574f89e /extensions/ProdCompSearch
parente21bf08fa7ce702453c943964607872a60ba0cd8 (diff)
downloadbugzilla-82c9e29116729ab27578a80ffb306abe107c0088.tar.gz
bugzilla-82c9e29116729ab27578a80ffb306abe107c0088.tar.xz
Bug 1305457 - product and component quick search does not work from describecomponents.cgi gives error if not logged in
Diffstat (limited to 'extensions/ProdCompSearch')
-rw-r--r--extensions/ProdCompSearch/web/js/prod_comp_search.js11
1 files changed, 7 insertions, 4 deletions
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,