Projet

Général

Profil

0001-js-invalidate-leaflet-map-when-container-is-displaye.patch

Frédéric Péters, 30 avril 2016 09:21

Télécharger (1,62 ko)

Voir les différences:

Subject: [PATCH] js: invalidate leaflet map when container is displayed
 (#10780)

 wcs/qommon/static/js/qommon.admin.js | 1 +
 wcs/qommon/static/js/qommon.map.js   | 4 ++++
 2 files changed, 5 insertions(+)
wcs/qommon/static/js/qommon.admin.js
12 12
    });
13 13
    $('.foldable').click(function() {
14 14
       $(this).toggleClass('folded').next().toggle();
15
       $(this).next().find('.qommon-map').trigger('qommon:invalidate');
15 16
    });
16 17
    $('.foldable.folded').next().hide();
17 18

  
wcs/qommon/static/js/qommon.map.js
44 44
       map.marker.setLatLng(coords);
45 45
       hidden.val(coords.lat + ';' + coords.lng);
46 46
     });
47
     $map_widget.on('qommon:invalidate', function() {
48
             console.log('invalidate');
49
       map.invalidateSize();
50
     });
47 51
     var is_backoffice = ($map_widget.parents('form').data('is-backoffice') == true);
48 52
     position_prefil = $map_widget.parent().parent().data('geolocation') == 'position';
49 53
     if (! ($map_widget.data('readonly') || is_backoffice) && ($map_widget.data('init-with-geoloc') || position_prefil)) {
50
-