fix: perbaiki navigasi back di halaman laporan penilai dan tampilkan gambar/pdf pada daftar pustaka
This commit is contained in:
@@ -58,11 +58,13 @@
|
||||
const fileExtension = url.split('.').pop().toLowerCase();
|
||||
const previewContent = document.getElementById('previewContent');
|
||||
|
||||
const urlStorage = 'storage' + '/' + url;
|
||||
|
||||
if (['pdf'].includes(fileExtension)) {
|
||||
PDFObject.embed(url, "#previewContent");
|
||||
PDFObject.embed(urlStorage, "#previewContent");
|
||||
} else if (['jpg', 'jpeg', 'png', 'gif'].includes(fileExtension)) {
|
||||
previewContent.innerHTML =
|
||||
`<img src="${url}" alt="Preview" class="max-w-full max-h-full object-contain">`;
|
||||
`<img src="${urlStorage}" alt="Preview" class="max-w-full max-h-full object-contain">`;
|
||||
} else {
|
||||
previewContent.innerHTML = '<p class="text-center">Unsupported file type</p>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user