Commit 974091eb22a4ecc83df41f9709368c7a850f5b9b
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
funcion addCustomButton() See merge request !5
Showing
2 changed files
Show diff stats
src/js/service.js
... | ... | @@ -7,22 +7,32 @@ angular.module('focaBotoneraLateral') |
7 | 7 | pausar: false, |
8 | 8 | guardar: false, |
9 | 9 | funcionGuardar: undefined, |
10 | - pathCancelar: undefined | |
10 | + pathCancelar: undefined, | |
11 | + custom: [] | |
11 | 12 | }; |
12 | 13 | |
13 | 14 | this.showSalir = function(value) { |
15 | + this.botones.custom = []; | |
14 | 16 | this.botones.salir = value; |
15 | 17 | }; |
16 | 18 | this.showPausar = function(value) { |
19 | + this.botones.custom = []; | |
17 | 20 | this.botones.pausar = value; |
18 | 21 | }; |
19 | 22 | this.showCancelar = function(value, path) { |
23 | + this.botones.custom = []; | |
20 | 24 | this.botones.cancelar = value; |
21 | 25 | this.botones.pathCancelar = (path) ? path : undefined; |
22 | 26 | }; |
23 | 27 | this.showGuardar = function(value, funcion) { |
28 | + this.botones.custom = []; | |
24 | 29 | this.botones.guardar = value; |
25 | 30 | if(value) this.botones.funcionGuardar = funcion; |
26 | 31 | }; |
27 | - | |
32 | + this.addCustomButton = function(title, funcion) { | |
33 | + this.botones.custom.push({ | |
34 | + title: title, | |
35 | + funcion: funcion | |
36 | + }); | |
37 | + }; | |
28 | 38 | }); |
src/views/botonera-lateral.html
... | ... | @@ -35,6 +35,17 @@ |
35 | 35 | class="btn btn-block border border-dark"> |
36 | 36 | <strong>SALIR</strong> |
37 | 37 | </button> |
38 | + <button | |
39 | + ng-repeat="boton in botones.custom" | |
40 | + ng-click="boton.funcion()" | |
41 | + type="button" | |
42 | + title="{{boton.title}}" | |
43 | + class="btn btn-block border border-dark"> | |
44 | + <strong | |
45 | + class="text-uppercase" | |
46 | + ng-bind="boton.title"> | |
47 | + </strong> | |
48 | + </button> | |
38 | 49 | </div> |
39 | 50 | </div> |
40 | 51 | </div> |