Commit 8f86edb61a4f4d3c2555178f114aa550562d915d
1 parent
f4de5418e8
Exists in
develop
Arreglo para poder navegar en los inputs de pago con tarjeta.
Showing
2 changed files
with
13 additions
and
7 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -128,11 +128,15 @@ angular.module('focaModalFormaPago') |
128 | 128 | $scope.tarjeta = tarjeta; |
129 | 129 | animateForm(); |
130 | 130 | }; |
131 | - | |
131 | + | |
132 | 132 | $scope.next = function (key) { |
133 | 133 | if (key === 13) $scope.focused++; |
134 | 134 | }; |
135 | - | |
135 | + | |
136 | + $scope.focus = function (val) { | |
137 | + $scope.focused = val; | |
138 | + }; | |
139 | + | |
136 | 140 | $scope.cancel = function () { |
137 | 141 | $uibModalInstance.dismiss('cancel'); |
138 | 142 | }; |
src/views/modal-tarjetas.html
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | </div> |
42 | 42 | <div class="col col-sm-4 pl-1"> |
43 | 43 | <input |
44 | - class="form-control form-control-sm" | |
44 | + class="form-control form-control-sm foca-input" | |
45 | 45 | ng-model="terminal" |
46 | 46 | type="number" |
47 | 47 | ng-disabled="readonly" |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | </div> |
57 | 57 | <div class="col col-sm-3 pl-1"> |
58 | 58 | <input |
59 | - class="form-control form-control-sm" | |
59 | + class="form-control form-control-sm foca-input" | |
60 | 60 | ng-model="numeroCupon" |
61 | 61 | type="number" |
62 | 62 | ng-disabled="readonly" |
... | ... | @@ -71,12 +71,13 @@ |
71 | 71 | </div> |
72 | 72 | <div class="col col-sm-5 pl-1"> |
73 | 73 | <input |
74 | - class="form-control form-control-sm" | |
74 | + class="form-control form-control-sm foca-input" | |
75 | 75 | type="number" |
76 | 76 | ng-model="cuotas" |
77 | 77 | ng-disabled="readonly" |
78 | + ng-focus="focus(3)" | |
78 | 79 | foca-focus="focused == 3" |
79 | - ng-focus="focus(3)"> | |
80 | + ng-keypress="next($event.keyCode)"> | |
80 | 81 | </div> |
81 | 82 | </div> |
82 | 83 | </form> |
... | ... | @@ -85,13 +86,14 @@ |
85 | 86 | </div> |
86 | 87 | </div> |
87 | 88 | |
88 | - | |
89 | 89 | <div class="modal-footer d-flex" ng-class="{ 'justify-content-between': showForm }"> |
90 | 90 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
91 | 91 | <button |
92 | 92 | class="btn btn-sm btn-primary" |
93 | 93 | type="button" |
94 | 94 | ng-click="aceptarFormaDePago()" |
95 | + ng-focus="focus(4)" | |
96 | + foca-focus="focused == 4" | |
95 | 97 | ng-show="showForm">Aceptar |
96 | 98 | </button> |
97 | 99 | </div> |