Commit 76955028f04676498b29bc543edbeec01e948359

Authored by Jose Pinto
1 parent fd67e8a21b
Exists in master

arreglo mapa, seleccionable en todo el tr

src/js/controller.js
... ... @@ -73,11 +73,17 @@ angular.module('focaModalPuntoDescarga')
73 73 });
74 74 };
75 75  
76   - $scope.seleccionarPunto = function(idx) {
  76 + $scope.seleccionarPunto = function(idx, esCheckbox) {
77 77 var indexPunto = $scope.puntosSeleccionados.indexOf(idx);
78 78 if(indexPunto !== -1) {
  79 + if(!esCheckbox){
  80 + $scope.puntosDescarga[idx].seleccionado = false;
  81 + }
79 82 $scope.puntosSeleccionados.splice(indexPunto, 1);
80 83 }else {
  84 + if(!esCheckbox){
  85 + $scope.puntosDescarga[idx].seleccionado = true;
  86 + }
81 87 $scope.puntosSeleccionados.push(idx);
82 88 }
83 89 };
src/js/osm-directive.js
... ... @@ -12,7 +12,7 @@ angular.module('focaModalPuntoDescarga').directive('osmPuntoDescarga', function(
12 12 //resuelve bug mapa gris en modales
13 13 $timeout(function() {
14 14 $scope.map.invalidateSize();
15   - }, 1000);
  15 + }, 100);
16 16  
17 17 $scope.markers = [];
18 18 $scope.$watchGroup(['latitud', 'longitud'], function() {
src/views/modal-punto-descarga.html
... ... @@ -32,22 +32,29 @@
32 32 <tr class="selected"
33 33 ng-repeat="(key, puntoDescarga) in puntosDescarga | filter: filters"
34 34 >
35   - <td ng-bind="puntoDescarga.id | rellenarDigitos: 3: 0"></td>
36   - <td ng-bind="puntoDescarga.descripcion"></td>
37   - <td ng-bind="puntoDescarga.latitud"></td>
38   - <td ng-bind="puntoDescarga.longitud"></td>
39   - <td class="d-md-none text-primary">
40   - <i class="fa fa-circle-thin" aria-hidden="true"></i>
41   - </td>
42   - <td class="d-none d-md-table-cell">
  35 + <td
  36 + ng-bind="puntoDescarga.id | rellenarDigitos: 3: 0"
  37 + ng-click="seleccionarPunto(key)"></td>
  38 + <td
  39 + ng-bind="puntoDescarga.descripcion"
  40 + ng-click="seleccionarPunto(key)"></td>
  41 + <td
  42 + ng-bind="puntoDescarga.latitud"
  43 + ng-click="seleccionarPunto(key)"></td>
  44 + <td
  45 + ng-bind="puntoDescarga.longitud"
  46 + ng-click="seleccionarPunto(key)"></td>
  47 + <td>
43 48 <input
44 49 type="checkbox"
45 50 class="custom-control-input float-right"
46   - id="checkSelect{{key}}">
  51 + id="checkSelect{{key}}"
  52 + ng-model="puntoDescarga.seleccionado"
  53 + ng-change="seleccionarPunto(key, true)"
  54 + >
47 55 <label
48 56 class="custom-control-label float-right"
49   - for="checkSelect{{key}}"
50   - ng-click="seleccionarPunto(key)"></label>
  57 + for="checkSelect{{key}}"></label>
51 58 <button
52 59 type="button"
53 60 class="btn btn-xs p-1 float-right mr-5"
... ... @@ -202,6 +209,7 @@
202 209 latitud="puntoDescarga.latitud"
203 210 longitud="puntoDescarga.longitud"
204 211 zoom="14"
  212 + ng-if="ingreso"
205 213 />
206 214 </form>
207 215 </div>