Commit 921fade2fe16ded2f23736ca5eea6853a6081889
1 parent
38153067d5
Exists in
master
and in
1 other branch
Arreglo de identacion y de funcion en un foreach.
Showing
1 changed file
with
12 additions
and
12 deletions
Show diff stats
src/js/controllerTarjetas.js
| ... | ... | @@ -3,18 +3,18 @@ angular.module('focaBotoneraFacturador') |
| 3 | 3 | '$scope', |
| 4 | 4 | '$window', |
| 5 | 5 | 'APP', |
| 6 | - function($scope, $window, APP) { | |
| 7 | - this.$onInit = function() { | |
| 6 | + function ($scope, $window, APP) { | |
| 7 | + this.$onInit = function () { | |
| 8 | 8 | $scope.botones = $scope.$ctrl.botones; |
| 9 | 9 | //TODO: controlar que no se estiren los botones |
| 10 | - if(APP) return; | |
| 10 | + if (APP) return; | |
| 11 | 11 | var max = ($scope.$ctrl.max) ? $scope.$ctrl.max : 12; |
| 12 | - if($window.innerWidth > 576) { | |
| 13 | - while(($scope.botones.length % max) !== 0) { | |
| 12 | + if ($window.innerWidth > 576) { | |
| 13 | + while (($scope.botones.length % max) !== 0) { | |
| 14 | 14 | $scope.botones.push(''); |
| 15 | 15 | } |
| 16 | - }else { | |
| 17 | - while(($scope.botones.length % 4) !== 0) { | |
| 16 | + } else { | |
| 17 | + while (($scope.botones.length % 4) !== 0) { | |
| 18 | 18 | $scope.botones.push(''); |
| 19 | 19 | } |
| 20 | 20 | } |
| ... | ... | @@ -23,21 +23,21 @@ angular.module('focaBotoneraFacturador') |
| 23 | 23 | function nombreFuncion(string) { |
| 24 | 24 | var texto = 'seleccionar'; |
| 25 | 25 | var arr = string.split(' '); |
| 26 | - arr.forEach(function(palabra) { | |
| 26 | + arr.forEach(function (palabra) { | |
| 27 | 27 | palabra = palabra.charAt(0).toUpperCase() + palabra.slice(1); |
| 28 | 28 | texto += palabra; |
| 29 | 29 | }); |
| 30 | 30 | return texto; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - $scope.ejecutarFuncion = function(nombre) { | |
| 33 | + $scope.ejecutarFuncion = function (nombre) { | |
| 34 | 34 | $scope.$parent[nombreFuncion(nombre)](); |
| 35 | 35 | }; |
| 36 | 36 | |
| 37 | - $scope.activarBoton = function (boton){ | |
| 38 | - $scope.botones.forEach(boton => { | |
| 37 | + $scope.activarBoton = function (boton) { | |
| 38 | + $scope.botones.forEach(function (boton) { | |
| 39 | 39 | boton.active = false; |
| 40 | 40 | }); |
| 41 | 41 | boton.active = true; |
| 42 | 42 | }; |
| 43 | - }]); | |
| 43 | + }]); |