From e7de1e41e1b8f187f7e9d5feae23db0e350e55a2 Mon Sep 17 00:00:00 2001 From: Jose Pinto Date: Mon, 7 Jan 2019 14:59:28 -0300 Subject: [PATCH] funcion addCustomButton() --- src/js/service.js | 14 ++++++++++++-- src/views/botonera-lateral.html | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/js/service.js b/src/js/service.js index 653e530..713db43 100644 --- a/src/js/service.js +++ b/src/js/service.js @@ -7,22 +7,32 @@ angular.module('focaBotoneraLateral') pausar: false, guardar: false, funcionGuardar: undefined, - pathCancelar: undefined + pathCancelar: undefined, + custom: [] }; this.showSalir = function(value) { + this.botones.custom = []; this.botones.salir = value; }; this.showPausar = function(value) { + this.botones.custom = []; this.botones.pausar = value; }; this.showCancelar = function(value, path) { + this.botones.custom = []; this.botones.cancelar = value; this.botones.pathCancelar = (path) ? path : undefined; }; this.showGuardar = function(value, funcion) { + this.botones.custom = []; this.botones.guardar = value; if(value) this.botones.funcionGuardar = funcion; }; - + this.addCustomButton = function(title, funcion){ + this.botones.custom.push({ + title: title, + funcion: funcion + }); + }; }); diff --git a/src/views/botonera-lateral.html b/src/views/botonera-lateral.html index e8ad494..2bdc317 100644 --- a/src/views/botonera-lateral.html +++ b/src/views/botonera-lateral.html @@ -35,6 +35,14 @@ class="btn btn-block border border-dark"> SALIR + -- 1.9.1