summaryrefslogtreecommitdiffstats
path: root/extensions/ProdCompSearch/web/js
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-04-24 06:31:22 +0200
committerByron Jones <bjones@mozilla.com>2013-04-24 06:31:22 +0200
commit54fe9455d23b292eadaa851c7a3fdbb43e09f814 (patch)
treef8ecff54215259691e13fc113e090edbaf7af5fd /extensions/ProdCompSearch/web/js
parentca8762f064d4be411b72923354259013e2f0450f (diff)
downloadbugzilla-54fe9455d23b292eadaa851c7a3fdbb43e09f814.tar.gz
bugzilla-54fe9455d23b292eadaa851c7a3fdbb43e09f814.tar.xz
Bug 859534: improve component searching
Diffstat (limited to 'extensions/ProdCompSearch/web/js')
-rw-r--r--extensions/ProdCompSearch/web/js/prod_comp_search.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/extensions/ProdCompSearch/web/js/prod_comp_search.js b/extensions/ProdCompSearch/web/js/prod_comp_search.js
index 7cb1ec73b..f6c3f011c 100644
--- a/extensions/ProdCompSearch/web/js/prod_comp_search.js
+++ b/extensions/ProdCompSearch/web/js/prod_comp_search.js
@@ -48,13 +48,23 @@ YUI({
ioConfig: {
method: "POST",
headers: { 'Content-Type': 'application/json' }
+ },
+ on: {
+ error: function(e) {
+ if (console.error && e.response.meta.error) {
+ console.error(e.response.meta.error.message);
+ }
+ Y.one("#prod_comp_throbber").addClass('bz_default_hidden');
+ Y.one("#prod_comp_error").removeClass('bz_default_hidden');
+ }
}
});
dataSource.plug(Y.Plugin.DataSourceJSONSchema, {
schema: {
resultListLocator : "result.products",
- resultFields : [ "product", "component" ]
+ resultFields : [ "product", "component" ],
+ metaFields : { error : 'error' }
}
});
@@ -75,6 +85,7 @@ YUI({
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_error").addClass('bz_default_hidden');
},
results: function(e) {
Y.one("#prod_comp_throbber").addClass('bz_default_hidden');