mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 03:27:30 -04:00 
			
		
		
		
	Handle task duration change before focusout
This commit is contained in:
		
							parent
							
								
									75260b6fd3
								
							
						
					
					
						commit
						0aa0fb859e
					
				| @ -125,7 +125,7 @@ | ||||
|                                 </div> | ||||
|                             </td> | ||||
|                             <td style="padding: 0px 12px 12px 0 !important; width:100px"> | ||||
|                                 <input type="text" data-bind="value: duration.pretty, visible: !isEmpty(), valueUpdate: 'afterkeydown'" class="form-control duration"></div> | ||||
|                                 <input type="text" data-bind="value: duration.pretty, visible: !isEmpty()" class="form-control duration"></div> | ||||
|                                 <a href="#" data-bind="click: function() { setNow(), $root.refresh() }, visible: isEmpty()">{{ trans('texts.set_now') }}</a> | ||||
|                             </td> | ||||
|                             <td style="width:30px" class="td-icon"> | ||||
| @ -352,11 +352,6 @@ | ||||
| 
 | ||||
|         self.duration.pretty = ko.computed({ | ||||
|             read: function() { | ||||
|                 // handle the input being changed and the form is submitted before focus out
 | ||||
|                 if ($("input.duration").is(":focus")) { | ||||
|                     return $("input.duration").val(); | ||||
|                 } | ||||
| 
 | ||||
|                 var duration = false; | ||||
|                 var start = self.startTime(); | ||||
|                 var end = self.endTime(); | ||||
| @ -541,6 +536,13 @@ | ||||
|             showTimeDetails(); | ||||
|         @endif | ||||
| 
 | ||||
|         $('input.duration').keydown(function(event){ | ||||
|             if (event.keyCode == 13) { | ||||
|                 event.preventDefault(); | ||||
|                 return false; | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
|         // setup clients and project comboboxes
 | ||||
|         var clientId = {{ $clientPublicId }}; | ||||
|         var projectId = {{ $projectPublicId }}; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user