diff --git a/src/js/controller.js b/src/js/controller.js index 18a5c98..a99a712 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -2,14 +2,14 @@ angular.module('focaBotoneraPrincipal') .controller('focaBotoneraPrincipalController', [ '$scope', '$rootScope', '$timeout', '$location', '$localStorage', 'botones', 'focaModalService', 'APP', 'focaBotoneraLateralService', - function($scope, $rootScope, $timeout, $location, $localStorage, + function ($scope, $rootScope, $timeout, $location, $localStorage, botones, focaModalService, APP, focaBotoneraLateralService) { $scope.paginas = []; var botonesPorPagina = 10; - if(APP === 'distribuidor' || APP === 'transportista') { + if (APP === 'distribuidor' || APP === 'transportista') { botonesPorPagina = 3; } - for(var i = 0; i < botones.data.length; i += botonesPorPagina) { + for (var i = 0; i < botones.data.length; i += botonesPorPagina) { $scope.paginas.push(botones.data.slice(i, i + botonesPorPagina)); } @@ -18,17 +18,27 @@ angular.module('focaBotoneraPrincipal') focaBotoneraLateralService.showSalir(false); focaBotoneraLateralService.showCancelar(false); - $scope.irA = function(accion) { + $scope.rutas = $localStorage.rutas? JSON.parse($localStorage.rutas) : []; + + + $scope.irA = function (accion) { $location.path(accion); }; - $scope.logout = function() { + $scope.logout = function () { $location.path('/logout'); }; - $scope.showTerminal = function() { + $scope.showTerminal = function () { var key = $localStorage.terminalKey; focaModalService.info('Su terminal es: ' + key); }; + + init(); + + function init() { + + console.log($localStorage); + } } ]); diff --git a/src/views/foca-botonera-principal.html b/src/views/foca-botonera-principal.html index 6bec459..a84261c 100644 --- a/src/views/foca-botonera-principal.html +++ b/src/views/foca-botonera-principal.html @@ -1,7 +1,46 @@
+ \ No newline at end of file