Feature #29473 » feature-29473-v2.patch
| public/javascripts/application.js | ||
|---|---|---|
|
}
|
||
|
}
|
||
|
$(document).on('keydown', 'form input, 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');
|
||
|
// Click input[type=submit] if it exists.
|
||
|
// As a workaround for the problem that ajax request fails in `targetForm.submit();`
|
||
|
// Example: new_issue_category modal on the issues/edit
|
||
|
if (targetForm.find('input[type=submit]').length) {
|
||
|
targetForm.find('input[type=submit]').first().click();
|
||
|
} else {
|
||
|
targetForm.submit();
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
function hideOnLoad() {
|
||
|
$('.hol').hide();
|
||