Browse Source

Remove permalink and add tooltip

poi-dev
Léo Serre 2 years ago
parent
commit
4679eaa82a
  1. 10
      views/css/d.poi.css
  2. 19
      views/d.poi.edit.html
  3. 6
      views/js/d.poi_map.js

10
views/css/d.poi.css

@ -60,16 +60,6 @@ form.form h1 input {
font-size: 17px;
}
#permalink {
width: 808px;
margin: 10px 0 0 0px;
padding: 6px;
font-size: 11px;
font-style: italic;
color: #555;
}
.flex_line {
display: flex;
flex-direction: row;

19
views/d.poi.edit.html

@ -29,9 +29,6 @@
</select>
<input type="text" value="<?=$poi->name?>" name="name" id="name" placeholder="Nom de l'hébergement">
</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">
<input type="text" value="<?=$poi->lat?>" name="lat" id="lat" placeholder="Latitude">
@ -46,22 +43,6 @@
<script type="text/javascript">
$( "#slide-icon" ).click(function() {
$( "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>

6
views/js/d.poi_map.js

@ -46,13 +46,16 @@ $( document ).ready(function() {
});
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){
poi_layer.unbindTooltip();
poi_layer.setLatLng(e.latlng);
$("#lat").val(e.latlng.lat);
$("#lon").val(e.latlng.lng);
})
poi_layer.on('move', function(e){
poi_layer.unbindTooltip();
$("#lat").val(e.latlng.lat);
$("#lon").val(e.latlng.lng);
})
@ -61,9 +64,8 @@ $( document ).ready(function() {
iconSize: [24, 24],
iconAnchor: [12, 12]
});
$("#type_selector label").click(function(e) {
console.log(e);
poi_layer.unbindTooltip();
poiicon.options.iconUrl = e.currentTarget.firstChild.currentSrc;
poi_layer.setIcon(poiicon);
})
Loading…
Cancel
Save