Fix Ctrl+Enter to save tasks/shots

This commit is contained in:
2017-02-14 15:57:08 +01:00
parent aa90a4433f
commit b545288851

View File

@@ -466,9 +466,11 @@ $(function() {
var save_on_ctrl_enter = ['shot', 'asset', 'task'];
$(document).on('keyup', function(e){
if ($.inArray(ProjectUtils.context(), save_on_ctrl_enter)) {
// Save on Ctrl + Enter anytime except when comments is on focus
if ($('#comment_field') && $('#comment_field').not(':focus')){
if ($.inArray(save_on_ctrl_enter, ProjectUtils.context())) {
var active = document.activeElement;
// Save on Ctrl + Enter anytime except when comment field is on focus
if (active.id != 'comment_field'){
if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey){
$("#item-save").trigger( "click" );
}