Commit d5e95f17941adcb9571ad9c1be79a677e069cdcf

Authored by Benjamin Rodriguez
1 parent 8698e4c7ca
Exists in master and in 1 other branch develop

logita para botonera de pausa

... ... @@ -4,6 +4,7 @@
4 4 "description": "Componente de botonera lateral",
5 5 "main": "index.js",
6 6 "scripts": {
  7 + "refresh": "gulp uglify && cp tmp/foca-botonera-lateral.js ../wrapper-demo/node_modules/foca-botonera-lateral/dist/foca-botonera-lateral.min.js",
7 8 "test": "echo \"Error: no test specified\" && exit 1",
8 9 "compile": "gulp uglify",
9 10 "gulp-pre-commit": "gulp pre-commit",
src/js/controller.js
... ... @@ -10,6 +10,7 @@ angular.module('focaBotoneraLateral')
10 10  
11 11 $scope.pausar = function() {
12 12 focaBotoneraLateralService.setLSItem();
  13 + focaBotoneraLateralService.setLSRuta();
13 14 $location.path('/');
14 15 };
15 16  
... ... @@ -19,6 +19,11 @@ angular.module('focaBotoneraLateral')
19 19 val: ''
20 20 };
21 21  
  22 + this.rutasPausadas = {
  23 + label: 'rutas',
  24 + val: []
  25 + };
  26 +
22 27 this.showTeclado = function(value) {
23 28 this.botones.teclado = value;
24 29 };
... ... @@ -33,6 +38,19 @@ angular.module('focaBotoneraLateral')
33 38 this.setPausarData = function(obj) {
34 39 this.pausarData = obj;
35 40 };
  41 + this.setRutasPausadas = function(obj) {
  42 + var auxArray = [];
  43 + this.rutasPausadas.val.push(obj.val);
  44 + angular.forEach(this.rutasPausadas.val, function(ruta) {
  45 + var exists = false;
  46 + angular.forEach(auxArray, function(val2) {
  47 + if(angular.equals(ruta, val2)){ exists = true };
  48 + });
  49 + if(exists == false && ruta !== "") { auxArray.push(ruta); }
  50 + });
  51 +
  52 + this.rutasPausadas.val = auxArray;
  53 + };
36 54 this.showCancelar = function(value, path) {
37 55 this.botones.custom = [];
38 56 this.botones.cancelar = value;
... ... @@ -61,4 +79,8 @@ angular.module('focaBotoneraLateral')
61 79 this.setLSItem = function() {
62 80 $localStorage[this.pausarData.label] = JSON.stringify(this.pausarData.val);
63 81 };
  82 +
  83 + this.setLSRuta = function() {
  84 + $localStorage[this.rutasPausadas.label] = JSON.stringify(this.rutasPausadas.val);
  85 + };
64 86 }]);