diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index 41aa6bc..0af3853 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -28,4 +28,5 @@ $(() => { } $('.link-card').linkCard(); + $('#deleteCheckinModal').deleteCheckinModal(); }); \ No newline at end of file diff --git a/resources/assets/js/tissue.js b/resources/assets/js/tissue.js index f4afea3..3dffb76 100644 --- a/resources/assets/js/tissue.js +++ b/resources/assets/js/tissue.js @@ -55,4 +55,20 @@ }); }; + $.fn.deleteCheckinModal = function () { + return this.each(function () { + $(this).on('show.bs.modal', function (event) { + var target = $(event.relatedTarget); + var modal = $(this); + modal.find('.modal-body .date-label').text(target.data('date')); + modal.data('id', target.data('id')); + }).find('.btn-danger').on('click', function (event) { + var modal = $('#deleteCheckinModal'); + var form = modal.find('form'); + form.attr('action', form.attr('action').replace('@', modal.data('id'))); + form.submit(); + }) + }); + }; + })(jQuery); \ No newline at end of file diff --git a/resources/views/ejaculation/show.blade.php b/resources/views/ejaculation/show.blade.php index c33ce95..2be6b4a 100644 --- a/resources/views/ejaculation/show.blade.php +++ b/resources/views/ejaculation/show.blade.php @@ -89,20 +89,3 @@ @endslot @endcomponent @endsection - -@push('script') - - -@endpush \ No newline at end of file diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index 92c8c0e..9baa2b5 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -98,19 +98,3 @@ @endslot @endcomponent @endsection - -@push('script') - -@endpush \ No newline at end of file