Commit f4de5418e8f2c20e3dd78ddd7f9dfe441f70a2c9
1 parent
57db069691
Exists in
master
Agregado que se pueda navegar entre los inputs.
Showing
2 changed files
with
18 additions
and
6 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -96,11 +96,11 @@ angular.module('focaModalFormaPago') |
96 | 96 | function ($timeout, $filter, $scope, $uibModalInstance, focaModalTarjetasService, |
97 | 97 | parametros) { |
98 | 98 | |
99 | - $scope.parametros = parametros; | |
100 | - | |
101 | 99 | //#region Variables |
100 | + $scope.parametros = parametros; | |
102 | 101 | $scope.botonesTarjetas = []; |
103 | 102 | $scope.showForm = false; |
103 | + $scope.focused = 1; | |
104 | 104 | |
105 | 105 | //#endregion |
106 | 106 | |
... | ... | @@ -128,7 +128,11 @@ angular.module('focaModalFormaPago') |
128 | 128 | $scope.tarjeta = tarjeta; |
129 | 129 | animateForm(); |
130 | 130 | }; |
131 | - | |
131 | + | |
132 | + $scope.next = function (key) { | |
133 | + if (key === 13) $scope.focused++; | |
134 | + }; | |
135 | + | |
132 | 136 | $scope.cancel = function () { |
133 | 137 | $uibModalInstance.dismiss('cancel'); |
134 | 138 | }; |
src/views/modal-tarjetas.html
... | ... | @@ -44,7 +44,10 @@ |
44 | 44 | class="form-control form-control-sm" |
45 | 45 | ng-model="terminal" |
46 | 46 | type="number" |
47 | - ng-disabled="readonly"> | |
47 | + ng-disabled="readonly" | |
48 | + foca-focus="focused == 1" | |
49 | + ng-focus="focus(1)" | |
50 | + ng-keypress="next($event.keyCode)"> | |
48 | 51 | </div> |
49 | 52 | </div> |
50 | 53 | <div class="row pb-3"> |
... | ... | @@ -56,7 +59,10 @@ |
56 | 59 | class="form-control form-control-sm" |
57 | 60 | ng-model="numeroCupon" |
58 | 61 | type="number" |
59 | - ng-disabled="readonly"> | |
62 | + ng-disabled="readonly" | |
63 | + foca-focus="focused == 2" | |
64 | + ng-focus="focus(2)" | |
65 | + ng-keypress="next($event.keyCode)"> | |
60 | 66 | </div> |
61 | 67 | </div> |
62 | 68 | <div class="row pb-3"> |
... | ... | @@ -68,7 +74,9 @@ |
68 | 74 | class="form-control form-control-sm" |
69 | 75 | type="number" |
70 | 76 | ng-model="cuotas" |
71 | - ng-disabled="readonly"> | |
77 | + ng-disabled="readonly" | |
78 | + foca-focus="focused == 3" | |
79 | + ng-focus="focus(3)"> | |
72 | 80 | </div> |
73 | 81 | </div> |
74 | 82 | </form> |