controller.js
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
angular.module('focaBotoneraPrincipal')
.controller('focaBotoneraPrincipalController', [
'$scope', '$rootScope', '$timeout', '$location', '$localStorage',
'botones', 'focaModalService', 'APP', 'focaBotoneraLateralService',
function ($scope, $rootScope, $timeout, $location, $localStorage,
botones, focaModalService, APP, focaBotoneraLateralService) {
$scope.paginas = [];
var botonesPorPagina = 10;
if (APP === 'distribuidor' || APP === 'transportista') {
botonesPorPagina = 3;
}
for (var i = 0; i < botones.data.length; i += botonesPorPagina) {
$scope.paginas.push(botones.data.slice(i, i + botonesPorPagina));
}
focaBotoneraLateralService.showGuardar(false);
focaBotoneraLateralService.showPausar(false);
focaBotoneraLateralService.showSalir(false);
focaBotoneraLateralService.showCancelar(false);
$scope.rutas = $localStorage.rutas ? JSON.parse($localStorage.rutas) : [];
$scope.irA = function (accion) {
$location.path(accion);
};
$scope.logout = function () {
$location.path('/logout');
};
$scope.showTerminal = function () {
var key = $localStorage.terminalKey;
focaModalService.info('Su terminal es: ' + key);
};
}
]);