From 511f3be38f12c8aa4b1de0374ba7a80cf4622c56 Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Mon, 21 Mar 2011 14:09:19 +0100 Subject: [PATCH] give the user feedback when narrowing dependent values failed --- assets/javascripts/reporting/filters.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/javascripts/reporting/filters.js b/assets/javascripts/reporting/filters.js index 76e97e8162..95e1a9c11b 100644 --- a/assets/javascripts/reporting/filters.js +++ b/assets/javascripts/reporting/filters.js @@ -274,6 +274,7 @@ Reporting.Filters = { evalScripts: true, postBody: Form.serialize('query_form'), onSuccess: function (response) { + Reporting.clearFlash(); if (response.responseJSON !== undefined) { var selectBox = $(dependents.first() + "_arg_1_val"); var selected = selectBox.select("option").collect(function (sel) { @@ -313,6 +314,11 @@ Reporting.Filters = { Reporting.Filters.narrow_values(sources, dependents); } } + }, + onException: function (response, error) { + Reporting.flash("Loading of filter values failed. Probably, the server is temporary offline for maintenance."); + var selectBox = $(dependents.first() + "_arg_1_val"); + $(selectBox).insert(new Element('option', {value: '<>'}).update('Failed to load values.')); } } );