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

View File

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

View File

@ -46,9 +46,28 @@ $(document).ready(function(){
localStorage.setItem('localLikes',JSON.stringify(localLikes)); 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) //LocalStorage Anpassen (Likes hinzufügen oder entfernen)

View File

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