diff options
Diffstat (limited to 'extensions/ProdCompSearch/web')
-rw-r--r-- | extensions/ProdCompSearch/web/js/prod_comp_search.js | 13 | ||||
-rw-r--r-- | extensions/ProdCompSearch/web/styles/prod_comp_search.css | 2 |
2 files changed, 13 insertions, 2 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'); diff --git a/extensions/ProdCompSearch/web/styles/prod_comp_search.css b/extensions/ProdCompSearch/web/styles/prod_comp_search.css index 71829023c..a89856e22 100644 --- a/extensions/ProdCompSearch/web/styles/prod_comp_search.css +++ b/extensions/ProdCompSearch/web/styles/prod_comp_search.css @@ -15,6 +15,6 @@ width: 360px; } -#prod_comp_no_components { +#prod_comp_no_components, #prod_comp_error { color: red; } |