When pressing ENTER in the input field, the button to process the field
is triggerd now. The OK button of the error modal is now focussed by
default.
Resolves: #70680
Releases: master
Change-Id: Ib056c5754a591e9b8b19b94cb338e75218a8bdca
Reviewed-on: http://review.typo3.org/44046
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
[{
text: TYPO3.lang['button.ok'] || 'OK',
btnClass: 'btn-' + Modal.getSeverityClass(top.TYPO3.Severity.error),
- name: 'ok'
+ name: 'ok',
+ active: true
}]
).on('confirm.button.ok', function() {
$confirm.modal('hide');
}]
);
- $modal.on('shown.bs.modal', function(e) {
+ $modal.on('shown.bs.modal', function() {
// focus the input field
- $(this).find('input.online-media-url').first().focus();
+ $(this).find('input.online-media-url').first().focus().on('keydown', function(e) {
+ if (e.keyCode === 13) {
+ $modal.find('button[name="ok"]').trigger('click');
+ }
+ });
});
});
};