update foto jaminan dan laporan preview
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const ruteLainnyaDiv = document.getElementById("ruteLainnya");
|
||||
const lantaiLainnyaDiv = document.getElementById("lantaiLainnya");
|
||||
// const lantaiLainnyaDiv = document.getElementById("lantaiLainnya");
|
||||
|
||||
// Function to add delete event listeners to existing buttons
|
||||
function addDeleteListeners(container) {
|
||||
container.querySelectorAll(".delete-button").forEach(button => {
|
||||
container.querySelectorAll(".delete-btn").forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
this.closest(
|
||||
".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5"
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// Add delete listeners to existing buttons
|
||||
addDeleteListeners(ruteLainnyaDiv);
|
||||
addDeleteListeners(lantaiLainnyaDiv);
|
||||
// addDeleteListeners(lantaiLainnyaDiv);
|
||||
|
||||
function createNewDiv(container, inputName) {
|
||||
const newDiv = document.createElement("div");
|
||||
@@ -49,12 +49,12 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-button">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
`;x
|
||||
container.appendChild(newDiv);
|
||||
addDeleteListeners(container);
|
||||
}
|
||||
@@ -63,12 +63,9 @@
|
||||
createNewDiv(ruteLainnyaDiv, "rute_lainnya");
|
||||
});
|
||||
|
||||
document.getElementById("btnAddMoreObject").addEventListener("click", function() {
|
||||
createNewDiv(lantaiLainnyaDiv, "lantai_lainnya");
|
||||
});
|
||||
|
||||
|
||||
|
||||
// document.getElementById("btnAddMoreObject").addEventListener("click", function() {
|
||||
// createNewDiv(lantaiLainnyaDiv, "lantai_lainnya");
|
||||
// });
|
||||
|
||||
function setupInputHandlers(containerId, buttonId, labelText, inputDataClass, buttonDeleteClass) {
|
||||
const addButton = document.getElementById(buttonId);
|
||||
@@ -190,8 +187,8 @@
|
||||
|
||||
setupInputHandlers('inputContainerRute', 'btnRute', 'Foto Rute Menuju Lokasi', 'file-input',
|
||||
'delete-btn');
|
||||
// setupInputHandlers('inputContainerLantai', 'btnLantai', 'Foto Lantai', 'file-input',
|
||||
// 'delete-btn');
|
||||
setupInputHandlers('inputContainerLantai', 'btnLantai', 'Foto Lantai', 'file-input',
|
||||
'delete-btn');
|
||||
setupInputHandlers('inputContainerLingkungan', 'btnLingkungan', 'Lingkungan', 'file-input',
|
||||
'delete-btn');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user