From bca1207918502291b707557e530833aab45b42f3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 31 Jul 2013 13:24:10 +0200 Subject: [PATCH] =?utf8?q?Pflichtenheftabsch=C3=A4tzung:=20Bei=20RETURN=20?= =?utf8?q?per=20AJAX=20speichern;=20"Speichern"-Button=20anzeigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/RequirementSpec.pm | 1 + js/requirement_spec.js | 8 ++++++++ .../requirement_spec/_edit_time_and_cost_estimate.html | 2 ++ 3 files changed, 11 insertions(+) diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm index 9da08f30d..58a037475 100644 --- a/SL/Controller/RequirementSpec.pm +++ b/SL/Controller/RequirementSpec.pm @@ -115,6 +115,7 @@ sub action_ajax_edit_time_and_cost_estimate { $self->js ->replaceWith('#time_cost_estimate', $html) + ->on('#time_cost_estimate INPUT[type=text]', 'keydown', 'kivi.requirement_spec.time_cost_estimate_input_key_down') ->render($self); } diff --git a/js/requirement_spec.js b/js/requirement_spec.js index 567f893a4..cb1024686 100644 --- a/js/requirement_spec.js +++ b/js/requirement_spec.js @@ -324,6 +324,14 @@ ns.standard_time_cost_estimate_ajax_call = function(key, opt) { return true; }; +ns.time_cost_estimate_input_key_down = function(event) { + if(event.keyCode == 13) { + event.preventDefault(); + ns.standard_time_cost_estimate_ajax_call('save'); + return false; + } +}; + // ------------------------------------------------------------------------- // --------------------------- quotations/orders --------------------------- // ------------------------------------------------------------------------- diff --git a/templates/webpages/requirement_spec/_edit_time_and_cost_estimate.html b/templates/webpages/requirement_spec/_edit_time_and_cost_estimate.html index f0e6831a9..1bd80929a 100644 --- a/templates/webpages/requirement_spec/_edit_time_and_cost_estimate.html +++ b/templates/webpages/requirement_spec/_edit_time_and_cost_estimate.html @@ -39,6 +39,8 @@ [%- END -%] + + [% L.button_tag("kivi.requirement_spec.standard_time_cost_estimate_ajax_call('save')", LxERP.t8("Save")) %] [%- END %] -- 2.20.1