diff options
author | David Lawrence <dkl@mozilla.com> | 2014-09-24 22:06:32 +0200 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2014-09-24 22:06:32 +0200 |
commit | 9f07124912d27f366ec50f94378026529ce18cde (patch) | |
tree | f84c42c760718767b654fbf51640eb1f4d143588 /extensions/ProdCompSearch/web/js | |
parent | 550d53cc7bc2ed66fd40ab6a276d9f65c6ac7278 (diff) | |
download | bugzilla-9f07124912d27f366ec50f94378026529ce18cde.tar.gz bugzilla-9f07124912d27f366ec50f94378026529ce18cde.tar.xz |
Bug 1059318: The drop-down box for components doesn't scroll
Diffstat (limited to 'extensions/ProdCompSearch/web/js')
-rw-r--r-- | extensions/ProdCompSearch/web/js/prod_comp_search.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/extensions/ProdCompSearch/web/js/prod_comp_search.js b/extensions/ProdCompSearch/web/js/prod_comp_search.js index cb4a50ccc..f294994e3 100644 --- a/extensions/ProdCompSearch/web/js/prod_comp_search.js +++ b/extensions/ProdCompSearch/web/js/prod_comp_search.js @@ -12,7 +12,8 @@ var ProdCompSearch = { script_choices: ['enter_bug.cgi', 'describecomponents.cgi'], format: null, cloned_bug_id: null, - new_tab: null + new_tab: null, + max_results: 100 }; YUI({ @@ -21,8 +22,8 @@ YUI({ }).use("node", "json-stringify", "autocomplete", "escape", "datasource-io", "datasource-jsonschema", function(Y) { Y.on("domready", function() { - var counter = 0, - dataSource = null, + var counter = 0, + dataSource = null, autoComplete = null; var resultListFormat = function(query, results) { @@ -39,7 +40,7 @@ YUI({ version: "1.1", method : "PCS.prod_comp_search", id : counter, - params : { search: query } + params : { search: query, limit: ProdCompSearch.max_results } }; return Y.JSON.stringify(json_object); }; @@ -79,13 +80,14 @@ YUI({ queryDelay: 0.05, resultFormatter: resultListFormat, suppressInputUpdate: true, - maxResults: 25, + maxResults: ProdCompSearch.max_results, scrollIntoView: true, requestTemplate: requestTemplate, on: { query: function(e) { Y.one("#prod_comp_throbber").removeClass('bz_default_hidden'); Y.one("#prod_comp_no_components").addClass('bz_default_hidden'); + Y.one("#prod_comp_too_many_components").addClass('bz_default_hidden'); Y.one("#prod_comp_error").addClass('bz_default_hidden'); }, results: function(e) { @@ -94,6 +96,9 @@ YUI({ if (e.results.length == 0) { Y.one("#prod_comp_no_components").removeClass('bz_default_hidden'); } + else if (e.results.length + 1 > ProdCompSearch.max_results) { + Y.one("#prod_comp_too_many_components").removeClass('bz_default_hidden'); + } }, select: function(e) { // Only redirect if the script_name is a valid choice |