Commit ad4ad9b64d61387d806f87c6c69f345db39ec9a7

Authored by Nicolás Guarnieri
Exists in master and in 2 other branches demo, develop

Merge branch 'master' into 'master'

Master (pmarco)

See merge request modulos-npm/foca-botonera-principal!10
src/js/controller.js
... ... @@ -3,11 +3,12 @@ angular.module('focaBotoneraPrincipal')
3 3 '$scope', '$location', '$cookies', 'botones', 'focaModalService', 'APP',
4 4 function($scope, $location, $cookies, botones, focaModalService, APP) {
5 5 $scope.paginas = [];
6   - if(APP === 'distribuidor') {
7   - $scope.paginas.push(botones.data.slice(0, 3));
8   - $scope.paginas.push(botones.data.slice(3, 6));
9   - } else {
10   - $scope.paginas.push(botones.data);
  6 + var botonesPorPagina = 12;
  7 + if(APP === 'distribuidor' || APP === 'transportista') {
  8 + botonesPorPagina = 3;
  9 + }
  10 + for(var i = 0; i < botones.data.length; i += botonesPorPagina){
  11 + $scope.paginas.push(botones.data.slice(i, i + botonesPorPagina));
11 12 }
12 13  
13 14 $scope.irA = function(accion) {