diff --git a/assets/javascripts/reporting.js b/assets/javascripts/reporting.js
index 515a912655..3484637d55 100644
--- a/assets/javascripts/reporting.js
+++ b/assets/javascripts/reporting.js
@@ -26,7 +26,12 @@ window.Reporting = {
if (type === undefined) {
type = "error";
}
- $("content").insert({before: "
" + string + "
"});
+ var flash = document.createElement('div');
+ flash.setAttribute('id', 'flash_' + type);
+ flash.setAttribute('onclick', '$(this).remove();');
+ flash.className = 'flash ' + type;
+ flash.innerHTML = string;
+ $("content").insert({before: flash});
},
fireEvent: function (element, event) {
diff --git a/assets/javascripts/reporting/controls.js b/assets/javascripts/reporting/controls.js
index 0eaf818e76..c3db22f27a 100644
--- a/assets/javascripts/reporting/controls.js
+++ b/assets/javascripts/reporting/controls.js
@@ -64,8 +64,12 @@ Reporting.Controls = {
send_settings_data: function (targetUrl, callback, failureCallback) {
if (failureCallback === undefined) {
- failureCallback = function () {
- Reporting.flash("There was an error getting the results. The administrator has been informed.");
+ failureCallback = function (response) {
+ if ((response.status + "")[0] === "4") {
+ Reporting.flash(response.responseText);
+ } else {
+ Reporting.flash("There was an error getting the results. The administrator has been informed.");
+ }
};
}
$$('div[id^=flash]').each(function (oldMsg) {