Fix Ctrl+Enter to save tasks/shots
This commit is contained in:
@@ -466,9 +466,11 @@ $(function() {
|
|||||||
|
|
||||||
var save_on_ctrl_enter = ['shot', 'asset', 'task'];
|
var save_on_ctrl_enter = ['shot', 'asset', 'task'];
|
||||||
$(document).on('keyup', function(e){
|
$(document).on('keyup', function(e){
|
||||||
if ($.inArray(ProjectUtils.context(), save_on_ctrl_enter)) {
|
if ($.inArray(save_on_ctrl_enter, ProjectUtils.context())) {
|
||||||
// Save on Ctrl + Enter anytime except when comments is on focus
|
var active = document.activeElement;
|
||||||
if ($('#comment_field') && $('#comment_field').not(':focus')){
|
|
||||||
|
// 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){
|
if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey){
|
||||||
$("#item-save").trigger( "click" );
|
$("#item-save").trigger( "click" );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user