♻️ refactor(js): pindahkan fungsi loading SweetAlert ke global scope dan perbaiki bug
- Memindahkan fungsi showLoadingSwal() dan hideLoadingSwal() ke resources/assets/js/app.js - Menambahkan fitur timer dan progress bar pada fungsi global loading - Menghapus duplikasi fungsi showLoadingSwal() dari penilai/index.blade.php (~18 baris) - Menghapus duplikasi fungsi dari penilaian/otorisator/index-sla.blade.php (~18 baris) - Menghapus duplikasi fungsi dari penilaian/otorisator/index.blade.php (~18 baris) - Menghapus duplikasi fungsi dari penilaian/paparan-so.blade.php (~18 baris) - Memperbaiki syntax error tag HTML di surveyor/components/informasi.blade.php - Membersihkan duplikasi fungsi & memperbaiki escape string di surveyor/js/utils.blade.php - Mengurangi ±90 baris kode duplikat, meningkatkan maintainability & UX (loading dialog lebih informatif)
This commit is contained in:
@@ -1,18 +1,4 @@
|
||||
<script>
|
||||
function showLoadingSwal(message) {
|
||||
Swal.fire({
|
||||
title: message,
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function hideLoadingSwal() {
|
||||
Swal.close();
|
||||
}
|
||||
|
||||
function previewImage(input, imageId) {
|
||||
const preview = document.getElementById(imageId);
|
||||
if (input.files && input.files[0]) {
|
||||
@@ -413,8 +399,9 @@
|
||||
const addressInput = document.getElementById('address');
|
||||
|
||||
if (status === 'sesuai') {
|
||||
addressInput.value = "{{ $dokumen->address ?? '' }}";
|
||||
inputs.forEach(element => {
|
||||
addressInput.value = {!! json_encode($dokumen->address ?? '') !!};
|
||||
|
||||
inputs.forEach(element => {
|
||||
if (element.tagName === 'INPUT') {
|
||||
element.setAttribute('readonly', true);
|
||||
} else if (element.tagName === 'SELECT') {
|
||||
|
||||
Reference in New Issue
Block a user