From 17bdcefdde1412bb69457aee19c260c4bc15821f Mon Sep 17 00:00:00 2001 From: Jose Pinto Date: Thu, 24 Jan 2019 17:54:35 -0300 Subject: [PATCH] parametro max --- src/js/app.js | 3 ++- src/js/controller.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index 583e34d..3946717 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -3,6 +3,7 @@ angular.module('focaBotoneraFacturador', []) templateUrl: 'src/views/botonera-facturador.html', controller: 'focaBotoneraFacturadorController', bindings: { - botones: '<' + botones: '<', + max: '<' } }); diff --git a/src/js/controller.js b/src/js/controller.js index 2abada7..ac26e08 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -5,9 +5,10 @@ angular.module('focaBotoneraFacturador') function($scope, $window) { this.$onInit = function() { $scope.botones = $scope.$ctrl.botones; + var max = ($scope.$ctrl.max) ? $scope.$ctrl.max : 12; if($window.innerWidth > 576) { - while(($scope.botones.length % 12) !== 0) { + while(($scope.botones.length % max) !== 0) { $scope.botones.push(''); } }else { -- 1.9.1