Commit 71ca5ecd9cb7d6b1f65e03a7a622163c7eb06ba5
1 parent
6137782ec8
Exists in
master
and in
1 other branch
fix bug focus
Showing
2 changed files
with
6 additions
and
3 deletions
 
Show diff stats
src/js/controller.js
| ... | ... | @@ -25,6 +25,9 @@ angular.module('focaModalCheque') | 
| 25 | 25 | if(sugerido && sugerido < 0) { | 
| 26 | 26 | $scope.cheque.importe = Math.abs(sugerido); | 
| 27 | 27 | } | 
| 28 | + $scope.next = function(key) { | |
| 29 | + if(key === 13) $scope.focused++; | |
| 30 | + }; | |
| 28 | 31 | |
| 29 | 32 | $scope.seleccionarBanco = function(key) { | 
| 30 | 33 | if(key === 13) { | 
src/views/modal-cheque.html
| ... | ... | @@ -91,7 +91,7 @@ | 
| 91 | 91 | placeholder="Librador" | 
| 92 | 92 | ng-model="cheque.librador" | 
| 93 | 93 | ng-required="true" | 
| 94 | - ng-keypress="focused = 5" | |
| 94 | + ng-keypress="next($event.keyCode)" | |
| 95 | 95 | foca-focus="focused == 4" | 
| 96 | 96 | ng-focus="focused = 4"/> | 
| 97 | 97 | </div> | 
| ... | ... | @@ -106,7 +106,7 @@ | 
| 106 | 106 | placeholder="Número" | 
| 107 | 107 | ng-model="cheque.numero" | 
| 108 | 108 | ng-required="true" | 
| 109 | - ng-keypress="focused = 6" | |
| 109 | + ng-keypress="next($event.keyCode)" | |
| 110 | 110 | foca-focus="focused == 5" | 
| 111 | 111 | ng-focus="focused = 5"/> | 
| 112 | 112 | </div> | 
| ... | ... | @@ -120,7 +120,7 @@ | 
| 120 | 120 | class="form-control form-control-sm" | 
| 121 | 121 | placeholder="Importe" | 
| 122 | 122 | ng-model="cheque.importe" | 
| 123 | - ng-keypress="focused = 7; datepickerOpen = true" | |
| 123 | + ng-keypress="next($event.keyCode)" | |
| 124 | 124 | ng-required="true" | 
| 125 | 125 | foca-focus="focused == 6" | 
| 126 | 126 | ng-focus="focused = 6"/> |