From: Moritz Bunkus Date: Wed, 31 Jul 2013 11:03:32 +0000 (+0200) Subject: Pflichtenheftitems: bei RETURN in Zeitabschätzung per AJAX abschicken X-Git-Tag: release-3.2.0beta~467^2~100 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e2e7e282c5c085a59e6ca334b0340f8dfa613417;p=kivitendo-erp.git Pflichtenheftitems: bei RETURN in Zeitabschätzung per AJAX abschicken --- diff --git a/SL/Controller/RequirementSpecItem.pm b/SL/Controller/RequirementSpecItem.pm index 0797a3ffd..7b1ed8194 100644 --- a/SL/Controller/RequirementSpecItem.pm +++ b/SL/Controller/RequirementSpecItem.pm @@ -258,6 +258,7 @@ sub action_ajax_edit { ->hide($content_top_id) ->remove("#${id_base}_form") ->insertAfter($html, $content_top_id) + ->on("#${id_base}_form INPUT[type=text]", "keydown", "kivi.requirement_spec.text_block_input_key_down") ->jstree->select_node('#tree', '#fb-' . $self->item->id) ->focus("#${id_base}_description") ->val('#current_content_type', $self->item->item_type) diff --git a/js/requirement_spec.js b/js/requirement_spec.js index 3e4c485fc..567f893a4 100644 --- a/js/requirement_spec.js +++ b/js/requirement_spec.js @@ -174,6 +174,15 @@ ns.ask_delete_text_block = function(key, opt) { return true; }; +ns.text_block_input_key_down = function(event) { + if(event.keyCode == 13) { + event.preventDefault(); + var prefix = $(this).attr('id').match("^edit_function_block_\\d+")[0]; + $("#" + prefix + "_submit").click(); + return false; + } +}; + // -------------------------------------------------------------------------------- // ------------------------------ sections and items ------------------------------ // -------------------------------------------------------------------------------- diff --git a/templates/webpages/requirement_spec_item/_function_block_form.html b/templates/webpages/requirement_spec_item/_function_block_form.html index 363141046..3c5429533 100644 --- a/templates/webpages/requirement_spec_item/_function_block_form.html +++ b/templates/webpages/requirement_spec_item/_function_block_form.html @@ -50,7 +50,7 @@

- [% L.ajax_submit_tag('controller.pl?action=RequirementSpecItem/ajax_' _ (SELF.item.id ? 'update' : 'create'), '#' _ id_base _ '_form', LxERP.t8('Save')) %] + [% L.ajax_submit_tag('controller.pl?action=RequirementSpecItem/ajax_' _ (SELF.item.id ? 'update' : 'create'), '#' _ id_base _ '_form', LxERP.t8('Save'), id=id_base _ '_submit') %] [%- LxERP.t8("Cancel") %]