From 921fade2fe16ded2f23736ca5eea6853a6081889 Mon Sep 17 00:00:00 2001 From: mpuebla Date: Mon, 22 Jul 2019 14:46:52 -0300 Subject: [PATCH] Arreglo de identacion y de funcion en un foreach. --- src/js/controllerTarjetas.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/js/controllerTarjetas.js b/src/js/controllerTarjetas.js index 2f0bce6..b3f5684 100644 --- a/src/js/controllerTarjetas.js +++ b/src/js/controllerTarjetas.js @@ -3,18 +3,18 @@ angular.module('focaBotoneraFacturador') '$scope', '$window', 'APP', - function($scope, $window, APP) { - this.$onInit = function() { + function ($scope, $window, APP) { + this.$onInit = function () { $scope.botones = $scope.$ctrl.botones; //TODO: controlar que no se estiren los botones - if(APP) return; + if (APP) return; var max = ($scope.$ctrl.max) ? $scope.$ctrl.max : 12; - if($window.innerWidth > 576) { - while(($scope.botones.length % max) !== 0) { + if ($window.innerWidth > 576) { + while (($scope.botones.length % max) !== 0) { $scope.botones.push(''); } - }else { - while(($scope.botones.length % 4) !== 0) { + } else { + while (($scope.botones.length % 4) !== 0) { $scope.botones.push(''); } } @@ -23,21 +23,21 @@ angular.module('focaBotoneraFacturador') function nombreFuncion(string) { var texto = 'seleccionar'; var arr = string.split(' '); - arr.forEach(function(palabra) { + arr.forEach(function (palabra) { palabra = palabra.charAt(0).toUpperCase() + palabra.slice(1); texto += palabra; }); return texto; } - $scope.ejecutarFuncion = function(nombre) { + $scope.ejecutarFuncion = function (nombre) { $scope.$parent[nombreFuncion(nombre)](); }; - $scope.activarBoton = function (boton){ - $scope.botones.forEach(boton => { + $scope.activarBoton = function (boton) { + $scope.botones.forEach(function (boton) { boton.active = false; }); boton.active = true; }; - }]); + }]); -- 1.9.1