From: Jan Büren Date: Fri, 26 Oct 2018 10:30:05 +0000 (+0200) Subject: E-Mail-Dialog: Knopf E-Mail senden ausgrauen um mehrfaches Senden zu verhindern X-Git-Tag: kivitendo-mebil_0.1-0~9^2~451 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=10fe22289afc69419e623b82a45df555e0c81ea6;p=kivitendo-erp.git E-Mail-Dialog: Knopf E-Mail senden ausgrauen um mehrfaches Senden zu verhindern Author: Jan Büren --- diff --git a/js/kivi.Order.js b/js/kivi.Order.js index f305afb26..f6d042752 100644 --- a/js/kivi.Order.js +++ b/js/kivi.Order.js @@ -134,6 +134,9 @@ namespace('kivi.Order', function(ns) { }; ns.send_email = function() { + // push button only once -> slow response from mail server + ns.email_dialog_disable_send(); + var data = $('#order_form').serializeArray(); data = data.concat($('[name^="email_form."]').serializeArray()); data = data.concat($('[name^="print_options."]').serializeArray()); @@ -465,6 +468,11 @@ namespace('kivi.Order', function(ns) { pp.o.multiple=1; pp.open_dialog(); }; +ns.email_dialog_disable_send = function() { + // disable mail send event to prevent + // impatient users to send multiple times + $('#send_email').prop('disabled', true); + }; ns.add_multi_items = function(data) { var insert_before_item_id = ns.get_insert_before_item_id($('#multi_items_position').val()); diff --git a/templates/webpages/common/_send_email_dialog.html b/templates/webpages/common/_send_email_dialog.html index 36713ea4a..9f03f7e5f 100644 --- a/templates/webpages/common/_send_email_dialog.html +++ b/templates/webpages/common/_send_email_dialog.html @@ -110,6 +110,6 @@

- [% L.button_tag(email_form.js_send_function, LxERP.t8("Send email")) %] + [% L.button_tag(email_form.js_send_function, LxERP.t8("Send email"), id='send_email') %] [% L.button_tag("\$('#send_email_dialog').dialog('close');", LxERP.t8("Abort")) %]