fixed cancel Button

master
nooahe 2022-11-15 16:37:33 +01:00
parent 98485ebb78
commit e5f851a22b
4 changed files with 37 additions and 5 deletions

View File

@ -2,6 +2,18 @@ h1 {
color: black;
}
#overlay{
}
.hidden{
display: none;
}
.show{
display: block;
}
#map {
height: 50vh;
width: 100%;
@ -13,7 +25,7 @@ h1 {
width: 30px;
}
#formular-wrapper {
#MapControls {
height: 50vh;
width: 50vh;
float: left;

View File

@ -27,17 +27,17 @@ dbVerbindungErzeugen()
</head>
<body>
<h1>spinn mit!!</h1>
<div id="map">
</div>
<div class="formular-wrapper">
<div class="MapControls">
<img src="/images/navigation.png" id="currentLocation">
</div>
<div id="idee_container">
<div id="overlay" class="hidden">
<img src="/images/cancel.png" id="cancel">
<div id="idee">

View File

@ -46,9 +46,28 @@ $(document).ready(function(){
localStorage.setItem('localLikes',JSON.stringify(localLikes));
}
})
function openOverlay(){
$("#overlay").removeClass("hidden").addClass("show")
$("#cancel").click(function() {
document.getElementById("idee").innerHTML = "";
$("#overlay").removeClass("show").addClass("hidden")
})
}
//LocalStorage Anpassen (Likes hinzufügen oder entfernen)

View File

@ -56,6 +56,7 @@ function addMarkers(){
marker.addListener("click", () => {
ideeAnzeigen(markerData[i]);
openOverlay();
})
}
@ -73,6 +74,7 @@ function addMarkers(){
map.addListener("click", (mapsMouseEvent) => {
newMarker(mapsMouseEvent.latLng);
openOverlay();
formularErstellen(mapsMouseEvent.latLng);
})
@ -94,7 +96,6 @@ function newMarker(mousePosition) {
newMarker.setIcon("/images/newMarker.jpg");
$("#cancel").click(function() {
document.getElementById("idee").innerHTML = "";
newMarker.setMap(null);
})