Commit ef028abf9d7c685c7c015d633237e02116c1ed12
1 parent
1caffe05d1
Exists in
master
and in
1 other branch
Arreglo con botones de aceptar.
Showing
3 changed files
with
14 additions
and
12 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -6,13 +6,14 @@ angular.module('focaModalFormaPago') |
| 6 | 6 | $uibModalInstance, focaModalFormaPagoService) { |
| 7 | 7 | |
| 8 | 8 | //#region Variables |
| 9 | - $scope.botonesTarjetas = []; | |
| 9 | + $scope.botones = []; | |
| 10 | 10 | //#endregion |
| 11 | 11 | |
| 12 | 12 | init(); |
| 13 | 13 | |
| 14 | 14 | function init() { |
| 15 | - $scope.botonesTarjetas = focaModalFormaPagoService.getBotonera(); | |
| 15 | + $scope.botones = focaModalFormaPagoService.getBotonera(); | |
| 16 | + console.log($scope.botones); | |
| 16 | 17 | } |
| 17 | 18 | |
| 18 | 19 | $scope.seleccionarContado = function () { |
| ... | ... | @@ -30,7 +31,7 @@ angular.module('focaModalFormaPago') |
| 30 | 31 | 'focaModalTarjetasController'); |
| 31 | 32 | modalInstance.result |
| 32 | 33 | .then(function (data) { |
| 33 | - console.log(data); | |
| 34 | + $uibModalInstance.close(data); | |
| 34 | 35 | }) |
| 35 | 36 | .catch(function (e) { console.error(e); }); |
| 36 | 37 | }; |
| ... | ... | @@ -82,10 +83,6 @@ angular.module('focaModalFormaPago') |
| 82 | 83 | $scope.cancel = function () { |
| 83 | 84 | $uibModalInstance.dismiss('cancel'); |
| 84 | 85 | }; |
| 85 | - | |
| 86 | - $scope.select = function (iva) { | |
| 87 | - $uibModalInstance.close(iva); | |
| 88 | - }; | |
| 89 | 86 | }] |
| 90 | 87 | ) |
| 91 | 88 | .controller('focaModalTarjetasController', [ |
| ... | ... | @@ -112,8 +109,8 @@ angular.module('focaModalFormaPago') |
| 112 | 109 | $uibModalInstance.dismiss('cancel'); |
| 113 | 110 | }; |
| 114 | 111 | |
| 115 | - $scope.select = function (iva) { | |
| 116 | - $uibModalInstance.close(iva); | |
| 112 | + $scope.aceptarFormaDePago = function () { | |
| 113 | + $uibModalInstance.close('data de tarjeta'); | |
| 117 | 114 | }; |
| 118 | 115 | |
| 119 | 116 | function animateForm() { |
src/views/modal-forma-pago.html
src/views/modal-tarjetas.html
| ... | ... | @@ -64,7 +64,12 @@ |
| 64 | 64 | </div> |
| 65 | 65 | |
| 66 | 66 | |
| 67 | -<div class="modal-footer d-flex justify-content-between"> | |
| 67 | +<div class="modal-footer d-flex" ng-class="{ 'justify-content-between': showForm }"> | |
| 68 | 68 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
| 69 | - <button class="btn btn-sm btn-primary" type="button" ng-click="cancel()">Aceptar</button> | |
| 69 | + <button | |
| 70 | + class="btn btn-sm btn-primary" | |
| 71 | + type="button" | |
| 72 | + ng-click="aceptarFormaDePago()" | |
| 73 | + ng-show="showForm">Aceptar | |
| 74 | + </button> | |
| 70 | 75 | </div> |