Commit 0422de01df18adebe7883124f6916510db6149b4

Authored by Benjamin Rodriguez
1 parent d72cb9686c
Exists in master

se elimina tarea pausada al guardar o salir

Showing 1 changed file with 11 additions and 12 deletions   Show diff stats
src/js/controller.js
... ... @@ -742,17 +742,6 @@ angular.module('focaCrearCobranza').controller('cobranzaController',
742 742  
743 743 $scope.salir = function () {
744 744 $location.path('/');
745   - var ar = JSON.parse($localStorage.rutas);
746   - function removeItemFromArr ( arr, item ) {
747   - var i = arr.indexOf( item );
748   -
749   - if ( i !== -1 ) {
750   - arr.splice( i, 1 );
751   - }
752   - }
753   -
754   - removeItemFromArr( ar, 'cobranza/crear' );
755   - $localStorage.rutas = JSON.stringify(ar);
756 745 };
757 746  
758 747 $scope.parsearATexto = function (articulo) {
... ... @@ -839,7 +828,9 @@ angular.module('focaCrearCobranza').controller('cobranzaController',
839 828 ).then(function (data) {
840 829 if (data) {
841 830 $location.path('/');
842   -
  831 + var ar = JSON.parse($localStorage.rutas);
  832 + removeItemFromArr( ar, 'cobranza/crear' );
  833 + $localStorage.rutas = JSON.stringify(ar);
843 834 }
844 835 });
845 836 } else {
... ... @@ -847,6 +838,14 @@ angular.module('focaCrearCobranza').controller('cobranzaController',
847 838 }
848 839 }
849 840  
  841 + function removeItemFromArr ( arr, item ) {
  842 + var i = arr.indexOf( item );
  843 +
  844 + if ( i !== -1 ) {
  845 + arr.splice( i, 1 );
  846 + }
  847 + }
  848 +
850 849 function setearCobranza(cobranza) {
851 850 $scope.editando = true;
852 851 $scope.$broadcast('cleanCabecera');