firstcommit
This commit is contained in:
24
resources/js/backend/mapDisplay.js
Normal file
24
resources/js/backend/mapDisplay.js
Normal file
@@ -0,0 +1,24 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
// Check if the mapInput class exists
|
||||
const mapInput = document.querySelector(".mapInput");
|
||||
if (mapInput) {
|
||||
const mapContainer = document.querySelector(".mapContainer");
|
||||
const mapCancel = document.querySelector(".map_cancel");
|
||||
|
||||
//Load map if iframe data exists
|
||||
if (mapInput.value) {
|
||||
mapContainer.innerHTML = mapInput.value;
|
||||
}
|
||||
|
||||
//Load iframe on input map data
|
||||
mapInput.addEventListener("input", function () {
|
||||
//Show map inside div
|
||||
mapContainer.innerHTML = mapInput.value;
|
||||
});
|
||||
|
||||
//Load default if click cancel button
|
||||
mapCancel.addEventListener("click", function () {
|
||||
mapContainer.innerHTML = mapInput.value;
|
||||
});
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user