Add support for "Ctrl + Enter" and "Meta (Cmd) + Enter" submit on multi-line fields

This commit is contained in:
Molkobain
2022-10-01 16:16:25 +02:00
parent 2dccedf8d7
commit 5e0698b7f3
5 changed files with 61 additions and 16 deletions

View File

@@ -58,6 +58,8 @@ $(function()
if((this.options.cancel_url !== null) && (this.options.cancel_url !== ''))
this.options.cancel_rule.url = this.options.cancel_url;
this._bindEvents();
this._super();
},
@@ -79,6 +81,16 @@ $(function()
{
this._super( key, value );
},
_bindEvents: function() {
const me = this;
// Submit event from the form should be treated as a click on the submit button
// as it processes things before sending the request
this.element.on('submit', function(oEvent) {
me._onSubmitClick(oEvent);
});
},
// - Callback when some fields have been touched
_onFieldsTouched: function(oEvent)
{

View File

@@ -125,8 +125,10 @@
{# CKEditor files for HTML WYSIWYG #}
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/ckeditor/ckeditor.js'|add_itop_version }}"></script>
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/ckeditor/adapters/jquery.js'|add_itop_version }}"></script>
{# Hilighter for code snippets created with CKEditor #}
{# - Hilighter for code snippets created with CKEditor #}
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js'|add_itop_version }}"></script>
{# - Custom settings #}
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/ckeditor.on-init.js'|add_itop_version }}"></script>
{# Date-time picker for Bootstrap #}
<script type="text/javascript" src="{{ app['combodo.portal.base.absolute_url'] ~ 'lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'|add_itop_version }}"></script>
{# Typeahead files for autocomplete #}