Relationship delivery_order_stock_entries für DeliveryOrderItem
[kivitendo-erp.git] / scripts / generate_client_js_actions.tpl
index 9e21802..a29b325 100644 (file)
@@ -5,9 +5,27 @@
 // SL/ClientJS.pm for instructions.
 
 namespace("kivi", function(ns) {
-ns.display_flash = function(type, message) {
+ns.display_flash = function(type, message, noscroll) {
   $('#flash_' + type + '_content').text(message);
   $('#flash_' + type).show();
+  if (!noscroll) {
+    $('#frame-header')[0].scrollIntoView();
+  }
+};
+
+ns.display_flash_detail = function(type, message) {
+  $('#flash_' + type + '_detail').html(message);
+  $('#flash_' + type + '_disp').show();
+};
+
+ns.clear_flash = function(category , timeout) {
+  window.setTimeout(function(){
+    $('#flash_' + category).hide();
+    $('#flash_detail_' + category).hide();
+    $('#flash_' + category + '_disp').hide();
+    $('#flash_' + category + '_content').empty();
+    $('#flash_' + category + '_detail').empty();
+  }, timeout);
 };
 
 ns.eval_json_result = function(data) {
@@ -19,7 +37,10 @@ ns.eval_json_result = function(data) {
 
   $(['info', 'warning', 'error']).each(function(idx, category) {
     $('#flash_' + category).hide();
+    $('#flash_detail_' + category).hide();
+    $('#flash_' + category + '_disp').hide();
     $('#flash_' + category + '_content').empty();
+    $('#flash_' + category + '_detail').empty();
   });
 
   if ((data.js || '') != '')