Commit 4cda1aee4883f402aa1dc2f794aa353f56129ba4
Exists in
master
Merge branch 'master' into 'master'
Master See merge request !8
Showing
2 changed files
Show diff stats
src/js/service.js
1 | angular.module('focaBotoneraLateral') | 1 | angular.module('focaBotoneraLateral') |
2 | .service('focaBotoneraLateralService', function() { | 2 | .service('focaBotoneraLateralService', function() { |
3 | 3 | ||
4 | this.botones = { | 4 | this.botones = { |
5 | teclado: true, | ||
5 | salir: false, | 6 | salir: false, |
6 | cancelar: false, | 7 | cancelar: false, |
7 | pausar: false, | 8 | pausar: false, |
8 | guardar: false, | 9 | guardar: false, |
9 | guardando: false, | 10 | guardando: false, |
10 | funcionGuardar: undefined, | 11 | funcionGuardar: undefined, |
11 | pathCancelar: undefined, | 12 | pathCancelar: undefined, |
12 | custom: [] | 13 | custom: [] |
13 | }; | 14 | }; |
14 | 15 | ||
16 | this.showTeclado = function(value) { | ||
17 | this.botones.teclado = value; | ||
18 | }; | ||
15 | this.showSalir = function(value) { | 19 | this.showSalir = function(value) { |
16 | this.botones.custom = []; | 20 | this.botones.custom = []; |
17 | this.botones.salir = value; | 21 | this.botones.salir = value; |
18 | }; | 22 | }; |
19 | this.showPausar = function(value) { | 23 | this.showPausar = function(value) { |
20 | this.botones.custom = []; | 24 | this.botones.custom = []; |
21 | this.botones.pausar = value; | 25 | this.botones.pausar = value; |
22 | }; | 26 | }; |
23 | this.showCancelar = function(value, path) { | 27 | this.showCancelar = function(value, path) { |
24 | this.botones.custom = []; | 28 | this.botones.custom = []; |
25 | this.botones.cancelar = value; | 29 | this.botones.cancelar = value; |
26 | this.botones.pathCancelar = (path) ? path : undefined; | 30 | this.botones.pathCancelar = (path) ? path : undefined; |
27 | }; | 31 | }; |
28 | this.showGuardar = function(value, funcion) { | 32 | this.showGuardar = function(value, funcion) { |
29 | angular.element('#guardar').removeClass('guardado'); | 33 | angular.element('#guardar').removeClass('guardado'); |
30 | this.botones.custom = []; | 34 | this.botones.custom = []; |
31 | this.botones.guardar = value; | 35 | this.botones.guardar = value; |
32 | if(value) this.botones.funcionGuardar = funcion; | 36 | if(value) this.botones.funcionGuardar = funcion; |
33 | }; | 37 | }; |
34 | this.addCustomButton = function(title, funcion) { | 38 | this.addCustomButton = function(title, funcion) { |
35 | this.botones.custom.push({ | 39 | this.botones.custom.push({ |
36 | title: title, | 40 | title: title, |
37 | funcion: funcion | 41 | funcion: funcion |
38 | }); | 42 | }); |
39 | }; | 43 | }; |
40 | this.startGuardar = function() { | 44 | this.startGuardar = function() { |
41 | this.botones.guardando = true; | 45 | this.botones.guardando = true; |
42 | }; | 46 | }; |
43 | this.endGuardar = function(guardado) { | 47 | this.endGuardar = function(guardado) { |
44 | this.botones.guardando = false; | 48 | this.botones.guardando = false; |
45 | if(guardado) angular.element('#guardar').addClass('guardado'); | 49 | if(guardado) angular.element('#guardar').addClass('guardado'); |
46 | }; | 50 | }; |
47 | }); | 51 | }); |
48 | 52 |
src/views/botonera-lateral.html
1 | <div class="container botonera-lateral"> | 1 | <div class="container botonera-lateral"> |
2 | <div class="row"> | 2 | <div class="row"> |
3 | <div class="col-auto my-2 col-2 offset-10 d-none d-md-flex" style="min-height: 176px"> | 3 | <div class="col-auto my-2 col-2 offset-10 d-none d-md-flex" style="min-height: 176px"> |
4 | <div class="px-2 mt-auto"> | 4 | <div class="px-2 mt-auto"> |
5 | <div class="container"> | 5 | <div class="container"> |
6 | <div class="row"> | 6 | <div class="row"> |
7 | <div | 7 | <div |
8 | ladda="botones.guardando" | 8 | ladda="botones.guardando" |
9 | data-spinner-size="30" | 9 | data-spinner-size="30" |
10 | data-spinner-color="#000000" | 10 | data-spinner-color="#000000" |
11 | class="mb-2 border border-dark rounded" | 11 | class="mb-2 border border-dark rounded" |
12 | > | 12 | > |
13 | <button | 13 | <button |
14 | id="guardar" | 14 | id="guardar" |
15 | ng-click="botones.funcionGuardar()" | 15 | ng-click="botones.funcionGuardar()" |
16 | ng-show="botones.guardar" | 16 | ng-show="botones.guardar" |
17 | ng-disabled="botones.guardando" | 17 | ng-disabled="botones.guardando" |
18 | type="button" | 18 | type="button" |
19 | title="Guardar" | 19 | title="Guardar" |
20 | class="btn btn-block"> | 20 | class="btn btn-block"> |
21 | <strong>GUARDAR</strong> | 21 | <strong>GUARDAR</strong> |
22 | </button> | 22 | </button> |
23 | </div> | 23 | </div> |
24 | <button | 24 | <button |
25 | ng-show="botones.pausar" | 25 | ng-show="botones.pausar" |
26 | type="button" | 26 | type="button" |
27 | title="Pausar" | 27 | title="Pausar" |
28 | class="btn btn-block border border-dark"> | 28 | class="btn btn-block border border-dark"> |
29 | <strong>PAUSAR</strong> | 29 | <strong>PAUSAR</strong> |
30 | </button> | 30 | </button> |
31 | <button | 31 | <button |
32 | ng-click="cancelar()" | 32 | ng-click="cancelar()" |
33 | ng-show="botones.cancelar" | 33 | ng-show="botones.cancelar" |
34 | type="button" | 34 | type="button" |
35 | title="Cancelar" | 35 | title="Cancelar" |
36 | class="btn btn-block border border-dark"> | 36 | class="btn btn-block border border-dark"> |
37 | <strong>CANCELAR</strong> | 37 | <strong>CANCELAR</strong> |
38 | </button> | 38 | </button> |
39 | <button | 39 | <button |
40 | ng-click="salir()" | 40 | ng-click="salir()" |
41 | ng-show="botones.salir" | 41 | ng-show="botones.salir" |
42 | type="button" | 42 | type="button" |
43 | title="Salir" | 43 | title="Salir" |
44 | class="btn btn-block border border-dark"> | 44 | class="btn btn-block border border-dark"> |
45 | <strong>SALIR</strong> | 45 | <strong>SALIR</strong> |
46 | </button> | 46 | </button> |
47 | <button | 47 | <button |
48 | ng-repeat="boton in botones.custom" | 48 | ng-repeat="boton in botones.custom" |
49 | ng-click="boton.funcion()" | 49 | ng-click="boton.funcion()" |
50 | type="button" | 50 | type="button" |
51 | title="{{boton.title}}" | 51 | title="{{boton.title}}" |
52 | class="btn btn-block border border-dark"> | 52 | class="btn btn-block border border-dark"> |
53 | <strong | 53 | <strong |
54 | class="text-uppercase" | 54 | class="text-uppercase" |
55 | ng-bind="boton.title"> | 55 | ng-bind="boton.title"> |
56 | </strong> | 56 | </strong> |
57 | </button> | 57 | </button> |
58 | </div> | 58 | </div> |
59 | </div> | 59 | </div> |
60 | </div> | 60 | </div> |
61 | </div> | 61 | </div> |
62 | </div> | 62 | </div> |
63 | </div> | 63 | </div> |
64 | <div class="container botonera-lateral teclado"> | 64 | <div class="container botonera-lateral teclado" ng-show="botones.teclado"> |
65 | <div class="row"> | 65 | <div class="row"> |
66 | <div class="col-auto my-2 col-2 offset-10 d-none d-md-flex" style="min-height: 176px"> | 66 | <div class="col-auto my-2 col-2 offset-10 d-none d-md-flex" style="min-height: 176px"> |
67 | <div class="px-2 mt-auto"> | 67 | <div class="px-2 mt-auto"> |
68 | <div class="container"> | 68 | <div class="container"> |
69 | <div class="row"> | 69 | <div class="row"> |
70 | <div | 70 | <div |
71 | class="btn-group-toggle btn btn-block btn-default border border-dark" | 71 | class="btn-group-toggle btn btn-block btn-default border border-dark" |
72 | data-toggle="buttons" | 72 | data-toggle="buttons" |
73 | ng-click="cambioUsoTeclado()" | 73 | ng-click="cambioUsoTeclado()" |
74 | title="Activar/desactivar teclado"> | 74 | title="Activar/desactivar teclado"> |
75 | <label | 75 | <label |
76 | class=" active boton-activar-teclado mb-0" | 76 | class=" active boton-activar-teclado mb-0" |
77 | ng-class="{'teclado-activar': usarTeclado}"> | 77 | ng-class="{'teclado-activar': usarTeclado}"> |
78 | <input | 78 | <input |
79 | type="checkbox" | 79 | type="checkbox" |
80 | autocomplete="off" | 80 | autocomplete="off" |
81 | > | 81 | > |
82 | <strong>TECLADO</strong> | 82 | <strong>TECLADO</strong> |
83 | </label> | 83 | </label> |
84 | </div> | 84 | </div> |
85 | </div> | 85 | </div> |
86 | </div> | 86 | </div> |
87 | </div> | 87 | </div> |
88 | </div> | 88 | </div> |
89 | </div> | 89 | </div> |
90 | </div> | 90 | </div> |
91 | 91 |