]> wagnertech.de Git - mfinanz.git/blobdiff - scripts/generate_client_js_actions.tpl
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[mfinanz.git] / scripts / generate_client_js_actions.tpl
index 6572e22c338d2cc62214706b6d9251f422024a87..7fa7baf95ec113f9a9d804525b1ac85bf936f35a 100644 (file)
@@ -4,10 +4,21 @@
 // "scripts/generate_client_js_actions.pl". See the documentation for
 // SL/ClientJS.pm for instructions.
 
+function display_flash(type, message) {
+  $('#flash_' + type + '_content').text(message);
+  $('#flash_' + type).show();
+}
+
 function eval_json_result(data) {
   if (!data)
     return;
 
+  if (data.error)
+    return display_flash('error', data.error);
+
+  $('#flash_error').hide();
+  $('#flash_error_content').empty();
+
   if ((data.js || '') != '')
     eval(data.js);
 
@@ -20,3 +31,7 @@ function eval_json_result(data) {
 
   // console.log("current_content_type " + $('#current_content_type').val() + ' ID ' + $('#current_content_id').val());
 }
+
+// Local Variables:
+// mode: js
+// End: