Skip to content
Snippets Groups Projects
Commit d4dbd2d0 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'hotline#143830_bug_carte_du_territoire' into 'master'

hotline #143830 call links event binding on openSteetMap popup

See merge request !4429
parents 1ef62739 5037a364
Branches
Tags
1 merge request!4429hotline #143830 call links event binding on openSteetMap popup
Pipeline #17140 passed with stage
in 43 minutes and 48 seconds
- correctif #143830 : Magasin de thèmes : Correction du bouton réserver dans la carte des bibliothèques des exemplaires. Le choix de retrait s'affiche maintenant correctement.
\ No newline at end of file
......@@ -123,13 +123,22 @@
originalPosition();
});
map.on('popupopen', function(event) {
$('.leaflet-popup-content img').on('load', function() {
event.popup.update();
})
event.popup.update();
if ( typeof initializePopups === 'function')
initializePopups();
if ( typeof setupAnchorsTarget === 'function')
setupAnchorsTarget();
});
originalPosition();
if (relative_zoom)
map.zoomIn(relative_zoom);
......
......@@ -35,7 +35,7 @@
<div
id="map"
class="leaflet_osm"
data-osm="[{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\&quot;>Concarneau<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;open&quot;,&quot;lat&quot;:&quot;47.8707978&quot;,&quot;lon&quot;:&quot;-3.9189743&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/elliant\&quot;>Elliant<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.996042&quot;,&quot;lon&quot;:&quot;-3.889371&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/melgven\&quot;>Melgven<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.906185&quot;,&quot;lon&quot;:&quot;-3.834563&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/nevez\&quot;>N\u00e9vez<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.8193549&quot;,&quot;lon&quot;:&quot;-3.7929785&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/pont_aven\&quot;>Pont-Aven<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.856974&quot;,&quot;lon&quot;:&quot;-3.743023&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/rosporden\&quot;>Rosporden<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.957613&quot;,&quot;lon&quot;:&quot;-3.827298&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/saint_yvi\&quot;>Saint-Yvi<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.967416&quot;,&quot;lon&quot;:&quot;-3.9402003&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/tregunc\&quot;>Tr\u00e9gunc<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.856571&quot;,&quot;lon&quot;:&quot;-3.8538288&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/tourc_h\&quot;>Tourc\u2019h<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;48.025213&quot;,&quot;lon&quot;:&quot;-3.82555&quot;}]"
data-osm="[{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\&quot; data-popup=\&quot;true\&quot;>Concarneau<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;open&quot;,&quot;lat&quot;:&quot;47.8707978&quot;,&quot;lon&quot;:&quot;-3.9189743&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/elliant\&quot;>Elliant<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.996042&quot;,&quot;lon&quot;:&quot;-3.889371&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/melgven\&quot;>Melgven<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.906185&quot;,&quot;lon&quot;:&quot;-3.834563&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/nevez\&quot;>N\u00e9vez<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.8193549&quot;,&quot;lon&quot;:&quot;-3.7929785&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/pont_aven\&quot;>Pont-Aven<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.856974&quot;,&quot;lon&quot;:&quot;-3.743023&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/rosporden\&quot;>Rosporden<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.957613&quot;,&quot;lon&quot;:&quot;-3.827298&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/saint_yvi\&quot;>Saint-Yvi<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.967416&quot;,&quot;lon&quot;:&quot;-3.9402003&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/tregunc\&quot;>Tr\u00e9gunc<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;47.856571&quot;,&quot;lon&quot;:&quot;-3.8538288&quot;},{&quot;html&quot;:&quot;<section><h2><a href=\&quot;\/ma-mediatheque\/tourc_h\&quot;>Tourc\u2019h<\/a><\/h2><div class=\&quot;fields\&quot;><\/div><\/section>&quot;,&quot;status&quot;:&quot;close&quot;,&quot;lat&quot;:&quot;48.025213&quot;,&quot;lon&quot;:&quot;-3.82555&quot;}]"
data-osm-geojson=""
data-osm-layer="1"
data-osm-zoom="0"
......@@ -51,6 +51,7 @@
<script src="../../java/leaflet.fullscreen-master/Leaflet.fullscreen.min.js"></script>
<script src="openStreetMap.js"></script>
<script src="http://code.jquery.com/qunit/qunit-1.13.0.js"></script>
<script src="../subModal.js"></script>
<script src="tests.js"></script>
</body>
</html>
......@@ -90,3 +90,12 @@ test('without osm_zoom after click page should return to absolute zoom 10', func
$('.leaflet-popup-close-button')[0].click();
equal(10, $('#map')[0].map.getZoom());
});
test('after popup click anchor should have an event binded', function() {
$('#map-container').openStreetMap();
$('.leaflet-marker-icon:first-child')[0].click();
$('.leaflet-popup-close-button')[0].click();
events = $._data($('a[href="/ma-mediatheque"]')[0], 'events');
equal(events['click'] !== undefined, true);
});
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment