Commit 5e8c50e6972f8850ce518fcc1183787d41717747
Exists in
develop
Merge branch 'master' into 'develop'
Master See merge request !10
Showing
2 changed files
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 | |
| ... | ... | @@ -129,6 +129,14 @@ angular.module('focaModalFormaPago') |
| 129 | 129 | animateForm(); |
| 130 | 130 | }; |
| 131 | 131 | |
| 132 | + $scope.next = function (key) { | |
| 133 | + if (key === 13) $scope.focused++; | |
| 134 | + }; | |
| 135 | + | |
| 136 | + $scope.focus = function (val) { | |
| 137 | + $scope.focused = val; | |
| 138 | + }; | |
| 139 | + | |
| 132 | 140 | $scope.cancel = function () { |
| 133 | 141 | $uibModalInstance.dismiss('cancel'); |
| 134 | 142 | }; |
src/views/modal-tarjetas.html
| ... | ... | @@ -41,10 +41,13 @@ |
| 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 | - 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"> |
| ... | ... | @@ -53,10 +56,13 @@ |
| 53 | 56 | </div> |
| 54 | 57 | <div class="col col-sm-3 pl-1"> |
| 55 | 58 | <input |
| 56 | - class="form-control form-control-sm" | |
| 59 | + class="form-control form-control-sm foca-input" | |
| 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"> |
| ... | ... | @@ -65,10 +71,13 @@ |
| 65 | 71 | </div> |
| 66 | 72 | <div class="col col-sm-5 pl-1"> |
| 67 | 73 | <input |
| 68 | - class="form-control form-control-sm" | |
| 74 | + class="form-control form-control-sm foca-input" | |
| 69 | 75 | type="number" |
| 70 | 76 | ng-model="cuotas" |
| 71 | - ng-disabled="readonly"> | |
| 77 | + ng-disabled="readonly" | |
| 78 | + ng-focus="focus(3)" | |
| 79 | + foca-focus="focused == 3" | |
| 80 | + ng-keypress="next($event.keyCode)"> | |
| 72 | 81 | </div> |
| 73 | 82 | </div> |
| 74 | 83 | </form> |
| ... | ... | @@ -77,13 +86,14 @@ |
| 77 | 86 | </div> |
| 78 | 87 | </div> |
| 79 | 88 | |
| 80 | - | |
| 81 | 89 | <div class="modal-footer d-flex" ng-class="{ 'justify-content-between': showForm }"> |
| 82 | 90 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
| 83 | 91 | <button |
| 84 | 92 | class="btn btn-sm btn-primary" |
| 85 | 93 | type="button" |
| 86 | 94 | ng-click="aceptarFormaDePago()" |
| 95 | + ng-focus="focus(4)" | |
| 96 | + foca-focus="focused == 4" | |
| 87 | 97 | ng-show="showForm">Aceptar |
| 88 | 98 | </button> |
| 89 | 99 | </div> |