Commit d0dcb6a421880e634978351a077be03a0d91a780
Exists in
master
Merge branch 'master' into 'master'
opcion path en boton cancelar See merge request !3
Showing
2 changed files
Show diff stats
src/js/controller.js
... | ... | @@ -17,6 +17,10 @@ angular.module('focaBotoneraLateral') |
17 | 17 | }; |
18 | 18 | |
19 | 19 | $scope.cancelar = function() { |
20 | - $window.history.back(); | |
20 | + if($scope.botones.pathCancelar) { | |
21 | + $location.path($scope.botones.pathCancelar); | |
22 | + }else { | |
23 | + $window.history.back(); | |
24 | + } | |
21 | 25 | }; |
22 | 26 | }]); |
src/js/service.js
... | ... | @@ -6,7 +6,8 @@ angular.module('focaBotoneraLateral') |
6 | 6 | cancelar: false, |
7 | 7 | pausar: false, |
8 | 8 | guardar: false, |
9 | - funcionGuardar: undefined | |
9 | + funcionGuardar: undefined, | |
10 | + pathCancelar: undefined | |
10 | 11 | }; |
11 | 12 | |
12 | 13 | this.showSalir = function(value) { |
... | ... | @@ -15,9 +16,9 @@ angular.module('focaBotoneraLateral') |
15 | 16 | this.showPausar = function(value) { |
16 | 17 | this.botones.pausar = value; |
17 | 18 | }; |
18 | - this.showCancelar = function(value, funcion) { | |
19 | + this.showCancelar = function(value, path) { | |
19 | 20 | this.botones.cancelar = value; |
20 | - if(value) this.botones.funcionCancelar = funcion; | |
21 | + if(path) this.botones.pathCancelar = path; | |
21 | 22 | }; |
22 | 23 | this.showGuardar = function(value, funcion) { |
23 | 24 | this.botones.guardar = value; |