perbaikan alamat, foto pembading, diskon, dan perbaikan tampilan kjjp
This commit is contained in:
@@ -200,8 +200,8 @@
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
// window.location.href =
|
||||
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
window.location.href =
|
||||
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -231,52 +231,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
function previewImage(input, previewId) {
|
||||
if (input.files && input.files[0]) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
$('#' + previewId).attr('src', e.target.result).show();
|
||||
}
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
} else {
|
||||
$('#' + previewId).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function addClonableItem(containerId, itemClass) {
|
||||
const container = document.getElementById(containerId);
|
||||
if (!container) {
|
||||
console.error(`Container with ID "${containerId}" not found.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const template = container.querySelector(`.${itemClass}`);
|
||||
if (!template) {
|
||||
console.error(`Template with class "${itemClass}" not found in container "${containerId}".`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Clone the template element
|
||||
const newElement = template.cloneNode(true);
|
||||
|
||||
// Reset input fields
|
||||
const inputs = newElement.querySelectorAll('input');
|
||||
inputs.forEach(input => {
|
||||
input.value = '';
|
||||
});
|
||||
|
||||
// Make the delete button visible and bind the click event
|
||||
const deleteButton = newElement.querySelector('.remove-btn');
|
||||
if (deleteButton) {
|
||||
deleteButton.style.display = 'inline-block';
|
||||
deleteButton.addEventListener('click', () => {
|
||||
newElement.remove();
|
||||
});
|
||||
}
|
||||
|
||||
// Append the cloned element to the container
|
||||
container.appendChild(newElement);
|
||||
}
|
||||
|
||||
// Ensure existing remove buttons are functional
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
Reference in New Issue
Block a user