Commit a365cc3f3507c06a81a1ad15ff7a6260c59fd3fa
1 parent
b21b501dfb
Exists in
master
elimina clase 'guardado' antes de mostrar boton guardar
Showing
1 changed file
with
1 additions
and
1 deletions
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 | salir: false, | 5 | salir: false, |
6 | cancelar: false, | 6 | cancelar: false, |
7 | pausar: false, | 7 | pausar: false, |
8 | guardar: false, | 8 | guardar: false, |
9 | guardando: false, | 9 | guardando: false, |
10 | funcionGuardar: undefined, | 10 | funcionGuardar: undefined, |
11 | pathCancelar: undefined, | 11 | pathCancelar: undefined, |
12 | custom: [] | 12 | custom: [] |
13 | }; | 13 | }; |
14 | 14 | ||
15 | this.showSalir = function(value) { | 15 | this.showSalir = function(value) { |
16 | this.botones.custom = []; | 16 | this.botones.custom = []; |
17 | this.botones.salir = value; | 17 | this.botones.salir = value; |
18 | }; | 18 | }; |
19 | this.showPausar = function(value) { | 19 | this.showPausar = function(value) { |
20 | this.botones.custom = []; | 20 | this.botones.custom = []; |
21 | this.botones.pausar = value; | 21 | this.botones.pausar = value; |
22 | }; | 22 | }; |
23 | this.showCancelar = function(value, path) { | 23 | this.showCancelar = function(value, path) { |
24 | this.botones.custom = []; | 24 | this.botones.custom = []; |
25 | this.botones.cancelar = value; | 25 | this.botones.cancelar = value; |
26 | this.botones.pathCancelar = (path) ? path : undefined; | 26 | this.botones.pathCancelar = (path) ? path : undefined; |
27 | }; | 27 | }; |
28 | this.showGuardar = function(value, funcion) { | 28 | this.showGuardar = function(value, funcion) { |
29 | angular.element('#guardar').removeClass('guardado'); | ||
29 | this.botones.custom = []; | 30 | this.botones.custom = []; |
30 | this.botones.guardar = value; | 31 | this.botones.guardar = value; |
31 | if(value) this.botones.funcionGuardar = funcion; | 32 | if(value) this.botones.funcionGuardar = funcion; |
32 | }; | 33 | }; |
33 | this.addCustomButton = function(title, funcion) { | 34 | this.addCustomButton = function(title, funcion) { |
34 | this.botones.custom.push({ | 35 | this.botones.custom.push({ |
35 | title: title, | 36 | title: title, |
36 | funcion: funcion | 37 | funcion: funcion |
37 | }); | 38 | }); |
38 | }; | 39 | }; |
39 | this.startGuardar = function() { | 40 | this.startGuardar = function() { |
40 | this.botones.guardando = true; | 41 | this.botones.guardando = true; |
41 | |||
42 | }; | 42 | }; |
43 | this.endGuardar = function(guardado) { | 43 | this.endGuardar = function(guardado) { |
44 | this.botones.guardando = false; | 44 | this.botones.guardando = false; |
45 | if(guardado) angular.element('#guardar').addClass('guardado'); | 45 | if(guardado) angular.element('#guardar').addClass('guardado'); |
46 | }; | 46 | }; |
47 | }); | 47 | }); |