Remove permalink and add tooltip
This commit is contained in:
parent
5034763a18
commit
4679eaa82a
|
@ -60,16 +60,6 @@ form.form h1 input {
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#permalink {
|
|
||||||
width: 808px;
|
|
||||||
margin: 10px 0 0 0px;
|
|
||||||
padding: 6px;
|
|
||||||
font-size: 11px;
|
|
||||||
font-style: italic;
|
|
||||||
color: #555;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex_line {
|
.flex_line {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
|
@ -29,9 +29,6 @@
|
||||||
</select>
|
</select>
|
||||||
<input type="text" value="<?=$poi->name?>" name="name" id="name" placeholder="Nom de l'hébergement">
|
<input type="text" value="<?=$poi->name?>" name="name" id="name" placeholder="Nom de l'hébergement">
|
||||||
</h1>
|
</h1>
|
||||||
<? if(isset($new) AND $new==1) { ?>
|
|
||||||
<input type="text" value="<?=$poi->permalink?>" name="permalink" id="permalink" placeholder="Permalien généré automatiquement" readonly>
|
|
||||||
<? } ?>
|
|
||||||
|
|
||||||
<div class="flex_line">
|
<div class="flex_line">
|
||||||
<input type="text" value="<?=$poi->lat?>" name="lat" id="lat" placeholder="Latitude">
|
<input type="text" value="<?=$poi->lat?>" name="lat" id="lat" placeholder="Latitude">
|
||||||
|
@ -46,22 +43,6 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$( "#slide-icon" ).click(function() {
|
$( "#slide-icon" ).click(function() {
|
||||||
$( "html, body" ).animate({scrollTop: "300px"});
|
$( "html, body" ).animate({scrollTop: "300px"});
|
||||||
});
|
|
||||||
$( "#name" ).keyup(function() {
|
|
||||||
permalink = $( "#name" ).val();
|
|
||||||
permalink = permalink.replace(/ /g,'_');
|
|
||||||
permalink = permalink.toLowerCase();
|
|
||||||
permalink = permalink.replace(/[^a-z0-9_]/g,'-');
|
|
||||||
permalink = permalink.replace(/[_-]+$/g,'');
|
|
||||||
$( "#permalink" ).val(permalink);
|
|
||||||
});
|
|
||||||
$( "#name" ).change(function() {
|
|
||||||
permalink = $( "#name" ).val();
|
|
||||||
permalink = permalink.replace(/ /g,'_');
|
|
||||||
permalink = permalink.toLowerCase();
|
|
||||||
permalink = permalink.replace(/[^a-z0-9_]/g,'-');
|
|
||||||
permalink = permalink.replace(/[_-]+$/g,'');
|
|
||||||
$( "#permalink" ).val(permalink);
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -46,13 +46,16 @@ $( document ).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
poi_layer = L.marker([-46.407, 51.766], {draggable: true}).addTo(mymap);
|
poi_layer = L.marker([-46.407, 51.766], {draggable: true}).addTo(mymap);
|
||||||
|
poi_layer.bindTooltip("Glissez moi au bon endroit.", {permanent: true, direction: 'top'}).openTooltip();
|
||||||
|
|
||||||
mymap.on('click', function(e){
|
mymap.on('click', function(e){
|
||||||
|
poi_layer.unbindTooltip();
|
||||||
poi_layer.setLatLng(e.latlng);
|
poi_layer.setLatLng(e.latlng);
|
||||||
$("#lat").val(e.latlng.lat);
|
$("#lat").val(e.latlng.lat);
|
||||||
$("#lon").val(e.latlng.lng);
|
$("#lon").val(e.latlng.lng);
|
||||||
})
|
})
|
||||||
poi_layer.on('move', function(e){
|
poi_layer.on('move', function(e){
|
||||||
|
poi_layer.unbindTooltip();
|
||||||
$("#lat").val(e.latlng.lat);
|
$("#lat").val(e.latlng.lat);
|
||||||
$("#lon").val(e.latlng.lng);
|
$("#lon").val(e.latlng.lng);
|
||||||
})
|
})
|
||||||
|
@ -61,9 +64,8 @@ $( document ).ready(function() {
|
||||||
iconSize: [24, 24],
|
iconSize: [24, 24],
|
||||||
iconAnchor: [12, 12]
|
iconAnchor: [12, 12]
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#type_selector label").click(function(e) {
|
$("#type_selector label").click(function(e) {
|
||||||
console.log(e);
|
poi_layer.unbindTooltip();
|
||||||
poiicon.options.iconUrl = e.currentTarget.firstChild.currentSrc;
|
poiicon.options.iconUrl = e.currentTarget.firstChild.currentSrc;
|
||||||
poi_layer.setIcon(poiicon);
|
poi_layer.setIcon(poiicon);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue