Commit e0942d9e30c5ffb761c777566c666081e7590c5c

Authored by Marcelo Puebla
Exists in master

Merge branch 'master' into 'develop'

Master(Macola)

See merge request !18
... ... @@ -4,6 +4,7 @@
4 4 "description": "Componente de botonera lateral",
5 5 "main": "index.js",
6 6 "scripts": {
  7 + "frefresh": "gulp uglify && cp tmp/foca-botonera-principal.js ../wrapper-facturador/node_modules/foca-botonera-principal/dist/foca-botonera-principal.min.js",
7 8 "refresh": "gulp uglify && cp tmp/foca-botonera-lateral.js ../wrapper-demo/node_modules/foca-botonera-lateral/dist/foca-botonera-lateral.min.js",
8 9 "test": "echo \"Error: no test specified\" && exit 1",
9 10 "compile": "gulp uglify",
... ... @@ -56,5 +57,8 @@
56 57 "jshint": "2.9.6",
57 58 "pre-commit": "1.2.2",
58 59 "pump": "3.0.0"
  60 + },
  61 + "dependencies": {
  62 + "node-sass": "^4.12.0"
59 63 }
60 64 }
... ... @@ -2,6 +2,18 @@ angular.module('focaBotoneraLateral')
2 2 .service('focaBotoneraLateralService', ['$localStorage',
3 3 function ($localStorage) {
4 4  
  5 + this.botones = {
  6 + teclado: true,
  7 + salir: false,
  8 + cancelar: false,
  9 + pausar: false,
  10 + guardar: false,
  11 + pagar: false,
  12 + guardando: false,
  13 + funcionGuardar: undefined,
  14 + pathCancelar: undefined,
  15 + custom: []
  16 + };
5 17 this.botones = {
6 18 teclado: true,
7 19 salir: false,
... ... @@ -19,6 +31,50 @@ angular.module('focaBotoneraLateral')
19 31 val: ''
20 32 };
21 33  
  34 + this.showTeclado = function(value) {
  35 + this.botones.teclado = value;
  36 + };
  37 + this.showSalir = function(value) {
  38 + this.botones.custom = [];
  39 + this.botones.salir = value;
  40 + };
  41 + this.showPausar = function(value) {
  42 + this.botones.custom = [];
  43 + this.botones.pausar = value;
  44 + };
  45 + this.setPausarData = function(obj) {
  46 + this.pausarData = obj;
  47 + };
  48 + this.showCancelar = function(value, path) {
  49 + this.botones.custom = [];
  50 + this.botones.cancelar = value;
  51 + this.botones.pathCancelar = (path) ? path : undefined;
  52 + };
  53 + this.showGuardar = function(value, funcion) {
  54 + angular.element('#guardar').removeClass('guardado');
  55 + this.botones.custom = [];
  56 + this.botones.guardar = value;
  57 + if (value) this.botones.funcionGuardar = funcion;
  58 + };
  59 + this.showPagar = function(value, funcion) {
  60 + angular.element('#pagar').removeClass('guardado');
  61 + this.botones.custom = [];
  62 + this.botones.pagar = value;
  63 + if (value) this.botones.funcionGuardar = funcion;
  64 + };
  65 + this.addCustomButton = function(title, funcion) {
  66 + this.botones.custom.push({
  67 + title: title,
  68 + funcion: funcion
  69 + });
  70 + };
  71 + this.startGuardar = function() {
  72 + this.botones.guardando = true;
  73 + };
  74 + this.endGuardar = function(guardado) {
  75 + this.botones.guardando = false;
  76 + if (guardado) angular.element('#guardar').addClass('guardado');
  77 + };
22 78 this.rutasPausadas = {
23 79 label: 'rutas',
24 80 val: []
src/views/botonera-lateral.html
... ... @@ -8,12 +8,29 @@
8 8 ladda="botones.guardando"
9 9 data-spinner-size="30"
10 10 data-spinner-color="#000000"
11   - class="mb-2 border rounded"
  11 + class="border rounded"
  12 + ng-show="botones.pagar"
  13 + >
  14 + <button
  15 + id="pagar"
  16 + ng-click="botones.funcionGuardar()"
  17 + ng-disabled="botones.guardando"
  18 + type="button"
  19 + title="Pagar"
  20 + class="btn btn-block">
  21 + <strong>PAGAR</strong>
  22 + </button>
  23 + </div>
  24 + <div
  25 + ladda="botones.guardando"
  26 + data-spinner-size="30"
  27 + data-spinner-color="#000000"
  28 + class="border rounded"
  29 + ng-show="botones.guardar"
12 30 >
13 31 <button
14 32 id="guardar"
15 33 ng-click="botones.funcionGuardar()"
16   - ng-show="botones.guardar"
17 34 ng-disabled="botones.guardando"
18 35 type="button"
19 36 title="Guardar"
... ... @@ -26,7 +43,7 @@
26 43 ng-show="botones.pausar"
27 44 type="button"
28 45 title="Pausar"
29   - class="btn btn-block border">
  46 + class="btn btn-block mt-2 border">
30 47 <strong>PAUSAR</strong>
31 48 </button>
32 49 <button
... ... @@ -34,7 +51,7 @@
34 51 ng-show="botones.cancelar"
35 52 type="button"
36 53 title="Cancelar"
37   - class="btn btn-block border border-dark">
  54 + class="btn btn-block mt-2 border border-dark">
38 55 <strong>CANCELAR</strong>
39 56 </button>
40 57 <button
... ... @@ -42,7 +59,7 @@
42 59 ng-show="botones.salir"
43 60 type="button"
44 61 title="Salir"
45   - class="btn btn-block border">
  62 + class="btn btn-block mt-2 border">
46 63 <strong>SALIR</strong>
47 64 </button>
48 65 <button
... ... @@ -50,7 +67,7 @@
50 67 ng-click="boton.funcion()"
51 68 type="button"
52 69 title="{{boton.title}}"
53   - class="btn btn-block border">
  70 + class="btn btn-block mt-2 border">
54 71 <strong
55 72 class="text-uppercase"
56 73 ng-bind="boton.title">
... ... @@ -69,7 +86,7 @@
69 86 <div class="container">
70 87 <div class="row">
71 88 <div
72   - class="btn-group-toggle btn btn-block border"
  89 + class="btn-group-toggle btn btn-block mt-2 border"
73 90 data-toggle="buttons"
74 91 ng-click="cambioUsoTeclado()"
75 92 title="Activar/desactivar teclado">