Feature #29473 » feature-29473.patch
| public/javascripts/application.js | ||
|---|---|---|
|
}
|
||
|
}( jQuery ));
|
||
|
var isSubmitAction;
|
||
|
var warnLeavingUnsavedMessage;
|
||
|
function warnLeavingUnsaved(message) {
|
||
|
warnLeavingUnsavedMessage = message;
|
||
| ... | ... | |
|
warn = true;
|
||
|
}
|
||
|
});
|
||
|
if (warn) {return warnLeavingUnsavedMessage;}
|
||
|
if (warn && !isSubmitAction) {isSubmitAction = false; return warnLeavingUnsavedMessage;}
|
||
|
};
|
||
|
}
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
$(document).on('keydown', 'form input, form textarea', function(e) {
|
||
|
// Click the form submit button with Ctrl + Enter or Command + Return as the trigger.
|
||
|
var submitButton = $(e.target).closest('form').find('input[type=submit]');
|
||
|
if(e.keyCode == 13 && ((e.ctrlKey && !e.metaKey) || (!e.ctrlKey && e.metaKey)) && submitButton.length) {
|
||
|
isSubmitAction = true;
|
||
|
submitButton.first().click();
|
||
|
}
|
||
|
});
|
||
|
function hideOnLoad() {
|
||
|
$('.hol').hide();
|
||