web: focus field after clicking add txn (fixes #338)
This commit is contained in:
		
							parent
							
								
									b175b8cddf
								
							
						
					
					
						commit
						7b1b1f5f8d
					
				| @ -5,6 +5,12 @@ | |||||||
| 
 | 
 | ||||||
| $(document).ready(function() { | $(document).ready(function() { | ||||||
| 
 | 
 | ||||||
|  |   // ensure add form always focusses its first field
 | ||||||
|  |   $('#addmodal') | ||||||
|  |     .on('shown.bs.modal', function (e) { | ||||||
|  |       addformFocus(); | ||||||
|  |     }) | ||||||
|  | 
 | ||||||
|   // show add form if ?add=1
 |   // show add form if ?add=1
 | ||||||
|   if ($.url.param('add')) { addformShow(true); } |   if ($.url.param('add')) { addformShow(true); } | ||||||
| 
 | 
 | ||||||
| @ -120,11 +126,7 @@ function registerChartClick(ev, pos, item) { | |||||||
| function addformShow(showmsg) { | function addformShow(showmsg) { | ||||||
|   showmsg = typeof showmsg !== 'undefined' ? showmsg : false; |   showmsg = typeof showmsg !== 'undefined' ? showmsg : false; | ||||||
|   addformReset(showmsg); |   addformReset(showmsg); | ||||||
|   $('#addmodal') |   $('#addmodal').modal('show'); | ||||||
|     .on('shown.bs.modal', function (e) { |  | ||||||
|       addformFocus(); |  | ||||||
|     }) |  | ||||||
|     .modal('show'); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // Make sure the add form is empty and clean for display.
 | // Make sure the add form is empty and clean for display.
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user