mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
Submit a form with Ctrl+Enter / Command+Return (#29473).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@19986 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -851,6 +851,14 @@ function setupFilePreviewNavigation() {
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('keydown', 'form textarea', function(e) {
|
||||
// Submit the form with Ctrl + Enter or Command + Return
|
||||
var targetForm = $(e.target).closest('form');
|
||||
if(e.keyCode == 13 && ((e.ctrlKey && !e.metaKey) || (!e.ctrlKey && e.metaKey) && targetForm.length)) {
|
||||
$(e.target).closest('form').find('textarea').blur().removeData('changed');
|
||||
targetForm.submit();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function hideOnLoad() {
|
||||
|
||||
Reference in New Issue
Block a user