From 33743d5fedf8defdaab9944afb708c13a007d9ea Mon Sep 17 00:00:00 2001 From: Jose Pinto Date: Mon, 21 Jan 2019 16:49:17 -0300 Subject: [PATCH] lat y lng no editables --- src/js/controller.js | 11 +++++++++++ src/js/osm-directive.js | 5 +++-- src/views/modal-punto-descarga.html | 7 +++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index cc99d23..003d059 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -14,6 +14,7 @@ angular.module('focaModalPuntoDescarga') $scope.articuloSeleccionado = 0; $scope.ivas = []; $scope.puntosSeleccionados = []; + $scope.editando = false; $scope.puntoDescarga = { id: 0, id_cliente: filters.idCliente, @@ -31,6 +32,14 @@ angular.module('focaModalPuntoDescarga') $scope.cancel = function() { if($scope.ingreso) { $scope.ingreso = false; + $scope.puntoDescarga = { + id: 0, + id_cliente: filters.idCliente, + id_da_config_0: filters.idDomicilio, + latitud: -32.89214159952345, + longitud: -68.84572999101856 + }; + $scope.editando = false; }else { $uibModalInstance.dismiss('cancel'); } @@ -57,6 +66,7 @@ angular.module('focaModalPuntoDescarga') latitud: -32.89214159952345, longitud: -68.84572999101856 }; + $scope.editando = false; }); }; @@ -64,6 +74,7 @@ angular.module('focaModalPuntoDescarga') focaModalPuntoDescargaService.getPuntoDescargaById(id).then(function(res) { $scope.puntoDescarga = res.data; $scope.ingreso = true; + $scope.editando = true; }); }; diff --git a/src/js/osm-directive.js b/src/js/osm-directive.js index c376535..67c1f58 100644 --- a/src/js/osm-directive.js +++ b/src/js/osm-directive.js @@ -20,7 +20,7 @@ angular.module('focaModalPuntoDescarga').directive('osmPuntoDescarga', function( $scope.map.removeLayer($scope.markers[i]); } $scope.markers.push( - L.marker([$scope.latitud, $scope.longitud], {draggable:'true'}) + L.marker([$scope.latitud, $scope.longitud], {draggable: $scope.draggable}) .addTo($scope.map) .on('dragend', function() { $scope.latitud = this.getLatLng().lat; @@ -33,7 +33,8 @@ angular.module('focaModalPuntoDescarga').directive('osmPuntoDescarga', function( scope: { latitud: '=', longitud: '=', - zoom: '=' + zoom: '=', + draggable: '<' } }; }); diff --git a/src/views/modal-punto-descarga.html b/src/views/modal-punto-descarga.html index c52cf2d..a4e9a1b 100644 --- a/src/views/modal-punto-descarga.html +++ b/src/views/modal-punto-descarga.html @@ -25,7 +25,7 @@ - + No se encontraron resultados. @@ -193,6 +193,7 @@ class="form-control form-control-sm" ng-model="puntoDescarga.latitud" ng-required="true" + ng-readonly="editando" />
@@ -202,6 +203,7 @@ class="form-control form-control-sm" ng-model="puntoDescarga.longitud" ng-required="true" + ng-readonly="editando" />
@@ -209,7 +211,8 @@ latitud="puntoDescarga.latitud" longitud="puntoDescarga.longitud" zoom="14" - ng-if="ingreso" + ng-if="ingreso", + draggable="!editando" /> -- 1.9.1