Skip to content

Commit 9061f3a

Browse files
authored
Merge pull request #4834 from Laravel-Backpack/optimize-delete-script
wrap the delete button script in a @loadOnce directive
2 parents aa80181 + daf1a64 commit 9061f3a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/resources/views/crud/buttons/delete.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{{-- Button Javascript --}}
66
{{-- - used right away in AJAX operations (ex: List) --}}
77
{{-- - pushed to the end of the page, after jQuery is loaded, for non-AJAX operations (ex: Show) --}}
8+
@loadOnce('delete_button_script')
89
@push('after_scripts') @if (request()->ajax()) @endpush @endif
910
<script>
1011
@@ -93,3 +94,4 @@ function deleteEntry(button) {
9394
// crud.addFunctionToDataTablesDrawEventQueue('deleteEntry');
9495
</script>
9596
@if (!request()->ajax()) @endpush @endif
97+
@endLoadOnce

0 commit comments

Comments
 (0)