Support using enter to submit task form
This commit is contained in:
parent
490269ad63
commit
e303691e96
1 changed files with 15 additions and 1 deletions
|
|
@ -41,7 +41,7 @@
|
|||
{!! Former::text('time_log') !!}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="row" onkeypress="formEnterClick(event)">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="panel panel-default">
|
||||
|
|
@ -490,6 +490,20 @@
|
|||
}
|
||||
}
|
||||
|
||||
function formEnterClick(event) {
|
||||
if (event.keyCode === 13){
|
||||
if (event.target.type == 'textarea') {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
@if ($task && $task->trashed())
|
||||
return;
|
||||
@endif
|
||||
submitAction('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('input[type=radio]').change(function() {
|
||||
onTaskTypeChange();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue