From 1b704f4779a861e895e0bd29f4a0b3216596f54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 3 Sep 2018 15:10:13 +0200 Subject: [PATCH] forms: don't let readonly maps be moved (#26036) --- wcs/qommon/static/js/qommon.map.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wcs/qommon/static/js/qommon.map.js b/wcs/qommon/static/js/qommon.map.js index 060de16f3..8ee049bdb 100644 --- a/wcs/qommon/static/js/qommon.map.js +++ b/wcs/qommon/static/js/qommon.map.js @@ -29,7 +29,6 @@ $(window).on('load', function() { new L.Control.Zoom({position: map_controls_position}).addTo(map); $map_widget[0].leaflet_map = map; var gps_control = new L.Control.Gps({position: map_controls_position}); - map.addControl(gps_control); var hidden = $(this).prev(); map.marker = null; var latlng; @@ -47,7 +46,10 @@ $(window).on('load', function() { attribution: map_attribution, maxZoom: map_options.maxZoom }).addTo(map); - if (! $map_widget.data('readonly')) { + if ($map_widget.data('readonly')) { + map.dragging.disable(); + } else { + map.addControl(gps_control); map.on('click', function(e) { $map_widget.trigger('set-geolocation', e.latlng); }); -- 2.19.0.rc1