->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)
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 ------------------------------
// --------------------------------------------------------------------------------
</div>
<p>
- [% 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') %]
<a href="#" onclick="kivi.requirement_spec.cancel_edit_item_form('[% id_base %]', { [% a_options %] })">[%- LxERP.t8("Cancel") %]</a>
</p>
</form>