Commit 6f9920104f3c8a2f6ec15b2150aa374dc0afa6be

Authored by Eric Fernandez
1 parent 54166f231f
Exists in develop

send boton to function

src/js/controllerTarjetas.js
... ... @@ -30,8 +30,8 @@ angular.module('focaBotoneraFacturador')
30 30 return texto;
31 31 }
32 32  
33   - $scope.ejecutarFuncion = function (nombre) {
34   - $scope.$parent[nombreFuncion(nombre)]();
  33 + $scope.ejecutarFuncion = function (boton) {
  34 + $scope.$parent[nombreFuncion(boton.label)](boton);
35 35 };
36 36  
37 37 $scope.activarBoton = function (boton) {
src/views/botonera-forma-pago.html
... ... @@ -7,7 +7,7 @@
7 7 class="btn btn-block btn-xs text-center rounded border border-light foca-overflow-hidden"
8 8 ng-disabled="boton.disabled"
9 9 ng-click="
10   - (boton != '') ? ejecutarFuncion(boton.label) : null;
  10 + (boton != '') ? ejecutarFuncion(boton) : null;
11 11 activarBoton(boton);"
12 12 >
13 13 <img ng-src="./img/{{boton.image}}" alt="">
src/views/botonera-tarjetas.html
... ... @@ -6,7 +6,7 @@
6 6 type="button"
7 7 class="btn btn-block btn-tarjeta rounded border p-1"
8 8 ng-click="
9   - (boton != '') ? ejecutarFuncion(boton.label) : null;
  9 + (boton != '') ? ejecutarFuncion(boton) : null;
10 10 activarBoton(boton);"
11 11 ng-class="
12 12 {
... ... @@ -16,6 +16,7 @@
16 16 }"
17 17 ng-disabled="boton.disable"
18 18 >
19   - <img ng-src="./img/{{boton.image}}" alt="">
  19 + <img ng-src="./img/{{boton.image || boton.imageDefault}}" alt="">
  20 + <label ng-if="!boton.image" ng-bind="boton.nombre"></label>
20 21 </button>
21 22 </div>