delete push script

This commit is contained in:
LailaWulandarii 2026-01-10 19:21:50 +07:00
parent f9ec292799
commit 71f381b069
1 changed files with 47 additions and 49 deletions

View File

@ -156,62 +156,60 @@
</section>
@include('admin.paket-foto.partials.modal-create-foto')
@include('admin.paket-foto.partials.modal-create-additional')
<script>
// FUNGSI PREVIEW UNIVERSAL (Bisa untuk Create & Edit)
function previewImage(input, previewId, placeholderId) {
const preview = document.getElementById(previewId);
const placeholder = document.getElementById(placeholderId);
const file = input.files[0];
@push('scripts')
<script>
// FUNGSI PREVIEW UNIVERSAL (Bisa untuk Create & Edit)
function previewImage(input, previewId, placeholderId) {
const preview = document.getElementById(previewId);
const placeholder = document.getElementById(placeholderId);
const file = input.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
preview.src = e.target.result;
preview.classList.remove('d-none');
if (placeholder) placeholder.classList.add('d-none');
}
reader.readAsDataURL(file);
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
preview.src = e.target.result;
preview.classList.remove('d-none');
if (placeholder) placeholder.classList.add('d-none');
}
reader.readAsDataURL(file);
}
}
document.addEventListener('DOMContentLoaded', function() {
function clearBackdrop() {
const backdrops = document.querySelectorAll('.modal-backdrop');
backdrops.forEach(b => b.remove());
document.body.classList.remove('modal-open');
}
document.addEventListener('DOMContentLoaded', function() {
function clearBackdrop() {
const backdrops = document.querySelectorAll('.modal-backdrop');
backdrops.forEach(b => b.remove());
document.body.classList.remove('modal-open');
}
// Error Create Paket Foto
@if (session('error_modal') === 'createFoto')
new bootstrap.Modal(document.getElementById('createFoto')).show();
@endif
// Error Create Paket Foto
@if (session('error_modal') === 'createFoto')
new bootstrap.Modal(document.getElementById('createFoto')).show();
@endif
// Error Create Additional
@if (session('error_modal') === 'createAdd')
new bootstrap.Modal(document.getElementById('createAdd')).show();
@endif
// Error Create Additional
@if (session('error_modal') === 'createAdd')
new bootstrap.Modal(document.getElementById('createAdd')).show();
@endif
// Error Edit Paket Foto
@if (session('error_id_foto'))
clearBackdrop();
new bootstrap.Modal(document.getElementById("editFoto{{ session('error_id_foto') }}")).show();
@endif
// Error Edit Paket Foto
@if (session('error_id_foto'))
clearBackdrop();
new bootstrap.Modal(document.getElementById("editFoto{{ session('error_id_foto') }}")).show();
@endif
// Error Edit Additional
@if (session('error_id_add'))
clearBackdrop();
new bootstrap.Modal(document.getElementById("editAdd{{ session('error_id_add') }}")).show();
@endif
});
// Error Edit Additional
@if (session('error_id_add'))
clearBackdrop();
new bootstrap.Modal(document.getElementById("editAdd{{ session('error_id_add') }}")).show();
@endif
});
// MODAL SHOW IMG
function showImage(src) {
var modalImg = document.getElementById('img-preview-target');
modalImg.src = src;
new bootstrap.Modal(document.getElementById('modalImagePreview')).show();
}
</script>
// MODAL SHOW IMG
function showImage(src) {
var modalImg = document.getElementById('img-preview-target');
modalImg.src = src;
new bootstrap.Modal(document.getElementById('modalImagePreview')).show();
}
</script>
@endpush
@endsection