]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1305457 - product and component quick search does not work from describecomponent...
authorDavid Lawrence <dkl@mozilla.com>
Wed, 12 Oct 2016 15:53:54 +0000 (15:53 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Wed, 12 Oct 2016 15:53:54 +0000 (15:53 +0000)
extensions/ProdCompSearch/web/js/prod_comp_search.js

index efbaab81b2c1cd75d21a0310b3fe202ca1414fdb..1b7e396a83673a775149b02ae587485dc2dc7cbd 100644 (file)
@@ -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,