Commit b7d752dd1c6e0e391c62fd65ab2913b3f5790553

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

Paginación de botonera y filtro de botones para dispositivos móviles.

src/js/controller.js
1 1 angular.module('focaBotoneraPrincipal')
2 2 .controller('focaBotoneraPrincipalController', [
3   - '$scope', '$location', '$cookies', 'botones', 'focaModalService',
4   - function($scope, $location, $cookies, botones, focaModalService) {
  3 + '$scope', '$location', '$cookies', 'botones', 'focaModalService', 'APP',
  4 + function($scope, $location, $cookies, botones, focaModalService, APP) {
5 5 $scope.paginas = [];
6   - $scope.paginas.push(botones.data);
  6 + if(APP !== '') {
  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);
  11 + }
7 12  
8 13 $scope.irA = function(accion) {
9 14 $location.path(accion);
... ... @@ -4,9 +4,12 @@ angular.module('focaBotoneraPrincipal')
4 4 controller: 'focaBotoneraPrincipalController',
5 5 templateUrl: 'src/views/foca-botonera-principal.html',
6 6 resolve: {
7   - botones: ['focaBotoneraPrincipalService', function(focaBotoneraPrincipalService) {
8   - return focaBotoneraPrincipalService.obtenerBotones();
9   - }]
  7 + botones: [
  8 + 'focaBotoneraPrincipalService', 'APP',
  9 + function(focaBotoneraPrincipalService, APP) {
  10 + return focaBotoneraPrincipalService.obtenerBotones(APP);
  11 + }
  12 + ]
10 13 }
11 14 });
12 15 }]);
... ... @@ -3,8 +3,8 @@ angular.module('focaBotoneraPrincipal')
3 3 '$http', 'API_ENDPOINT',
4 4 function($http, API_ENDPOINT) {
5 5 return {
6   - obtenerBotones: function() {
7   - return $http.get(API_ENDPOINT.URL + '/boton');
  6 + obtenerBotones: function(app) {
  7 + return $http.get(API_ENDPOINT.URL + '/boton' + '/' + app);
8 8 }
9 9 };
10 10 }