Commit 41fae26dbdbb36c21b941eda03bde7ab02042cfe

Authored by Pablo Marco del Pont
1 parent 51253718ad
Exists in master and in 2 other branches demo, develop

Fix botonera principal.

Showing 1 changed file with 6 additions and 5 deletions   Show diff stats
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) {