Commit a7f7b8b2590571ae66152d0958b76d06c8c93765
1 parent
725dfa435a
Exists in
master
opcion path boton cancelar
Showing
2 changed files
with
9 additions
and
4 deletions
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; |