X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fclient_js.js;h=6b3784a5a9fe9c50a9bbc88c2496f75a4bc42502;hb=ab183c9fc67a21dcbc57ab20ce8769727123db72;hp=a0e6eab61ca541cf725e340b108d1cbd4b3576dc;hpb=cbcf100f2bb4c4ae57cd423002ec17afcea2e756;p=kivitendo-erp.git diff --git a/js/client_js.js b/js/client_js.js index a0e6eab61..6b3784a5a 100644 --- a/js/client_js.js +++ b/js/client_js.js @@ -8,6 +8,22 @@ namespace("kivi", function(ns) { ns.display_flash = function(type, message) { $('#flash_' + type + '_content').text(message); $('#flash_' + type).show(); + $('#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 +35,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 || '') != '') @@ -128,9 +147,11 @@ ns.eval_json_result = function(data) { // ## other stuff ## else if (action[0] == 'redirect_to') window.location.href = action[1]; else if (action[0] == 'flash') kivi.display_flash(action[1], action[2]); + else if (action[0] == 'flash_detail') kivi.display_flash_detail(action[1], action[2]); else if (action[0] == 'reinit_widgets') kivi.reinit_widgets(); else if (action[0] == 'run') kivi.run(action[1], action.slice(2, action.length)); else if (action[0] == 'run_once_for') kivi.run_once_for(action[1], action[2], action[3]); + else if (action[0] == 'scroll_into_view') $(action[1])[0].scrollIntoView(); else console.log('Unknown action: ' + action[0]);