diff --git a/public/spesified-assets/user/detail-diagnosis-modal.js b/public/spesified-assets/user/detail-diagnosis-modal.js index 480b1b8..c0c242d 100644 --- a/public/spesified-assets/user/detail-diagnosis-modal.js +++ b/public/spesified-assets/user/detail-diagnosis-modal.js @@ -8,6 +8,7 @@ const headerPenyakitSolution = document.getElementById('headerPenyakitSolution') const rowDetailPenyakit = document.getElementById('rowDetailPenyakit'); const detailJawabanDiagnosisTable = document.getElementById('detailJawabanDiagnosisTable'); const tableBody = detailJawabanDiagnosisTable.querySelector('tbody'); +const placeholder = document.querySelectorAll('.placeholder'); let idPenyakit = null; let idDiagnosis = null; @@ -73,8 +74,6 @@ detailDiagnosisModal.addEventListener('show.bs.modal', async () => { function drawDetailDiagnosis(response, diagnosed) { if (diagnosed === false) { titleDetailDiagnosisModal.innerText = 'Detail Diagnosis No. ' + noHistoriDiagnosis; - } else { - titleDetailDiagnosisModal.innerText = 'Detail Diagnosis'; } if (response.penyakit == null || response.penyakitUnidentified === true) { @@ -89,7 +88,6 @@ function drawDetailDiagnosis(response, diagnosed) { headerDetailDiagnosis.classList.remove('d-none'); subheaderDetailDiagnosis.classList.remove('d-none'); - rowDetailPenyakit.classList.remove('d-none'); const penyakitName = document.getElementById('penyakitName'); const penyakitReason = document.getElementById('penyakitReason'); penyakitName.innerHTML = response.penyakit.name; @@ -117,13 +115,23 @@ function drawDetailDiagnosis(response, diagnosed) { }); imagePenyakit.addEventListener('click', () => { - const chocolatInstance = Chocolat([{ - src: assetStorage + '/' + response.penyakit.image, - title: response.penyakit.name, - }], {}); - chocolatInstance.api.open(); + const lebarLayar = window.innerWidth || document.documentElement.clientWidth || document + .body.clientWidth; + + if (lebarLayar >= 992) { + const chocolatInstance = Chocolat([{ + src: assetStorage + '/' + response.penyakit.image, + title: response.penyakit.name, + }], {}); + chocolatInstance.api.open(); + } }); } + + //remove class placeholder + placeholder.forEach((item) => { + item.classList.remove('placeholder'); + }); } function drawDetailJawabanDiagnosis(data) { @@ -159,14 +167,21 @@ detailDiagnosisModal.addEventListener('hide.bs.modal', () => { if (chartDiagnosisPenyakit != null) { chartDiagnosisPenyakit.destroy(); } + + rowDetailPenyakit.classList.remove('d-none'); }); detailDiagnosisModal.addEventListener('hidden.bs.modal', () => { + if (!document.body.classList.contains('modal-open')) { document.body.classList.add('modal-open'); } else { document.body.classList.remove('modal-open'); } + //add class placeholder + placeholder.forEach((item) => { + item.classList.add('placeholder'); + }); }); function drawChart(data) { diff --git a/public/spesified-assets/user/script.js b/public/spesified-assets/user/script.js index 4cf8a03..4d1b79c 100644 --- a/public/spesified-assets/user/script.js +++ b/public/spesified-assets/user/script.js @@ -220,12 +220,18 @@ function ajaxGetGejala() { document.addEventListener('DOMContentLoaded', async () => { const notyf = new Notyf({ position: { - x: 'right', + x: 'center', y: 'top', }, dismissible: true, }); + if (isUser) { + if (login != false) { + notyf.success(login); + } + } + const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]') const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip( tooltipTriggerEl)) @@ -437,15 +443,6 @@ document.addEventListener('DOMContentLoaded', async () => { }) } - if (isUser) { - if (login && !localStorage.getItem('notyfshown')) { - notyf.success(login); - localStorage.setItem('notyfshown', true); - } else { - localStorage.removeItem('notyfshown'); - } - } - const openImageChocolat = document.querySelectorAll('.open-image-chocolat'); openImageChocolat.forEach((element, index) => { diff --git a/resources/views/layouts/user/footer.blade.php b/resources/views/layouts/user/footer.blade.php index 2590ab5..7e2a88d 100644 --- a/resources/views/layouts/user/footer.blade.php +++ b/resources/views/layouts/user/footer.blade.php @@ -7,7 +7,7 @@

- SPDHTC (Sistem Pakar Diagnosis Penyakit Tanaman Cabai) merupakan hasil dari tugas akhir tim + SPDHTC (Sistem Pakar Diagnosis Penyakit Tanaman Cabai) merupakan hasil tugas akhir dari tim pengembang di Prodi Teknik Informatika Politeknik negeri Banjarmasin. SPDHTC menggunakan data yang diperoleh dari pakar yang berkompeten, sehingga keakuratan datanya dapat dipercaya. Latar belakang mengapa SPDHTC dibangun adalah untuk membantu masyarakat, terutama para petani cabai, diff --git a/resources/views/user/detail-diagnosis-modal.blade.php b/resources/views/user/detail-diagnosis-modal.blade.php index 592f6a2..91d80ab 100644 --- a/resources/views/user/detail-diagnosis-modal.blade.php +++ b/resources/views/user/detail-diagnosis-modal.blade.php @@ -1,19 +1,19 @@ -