submit.blade.php 860 B

1234567891011121314151617181920212223242526272829
  1. <div class="row">
  2. <div class="@if(!($right ?? null)) offset-md-{{ $offset ?? 4 }} col-md-8 @endif">
  3. <button type="submit" class="btn btn-primary text-white">{{ $name ?? 'Сохранить' }}</button>
  4. @if(isset($delete))
  5. <a href="#" class="btn btn-danger delete">{{ $delete['title'] }}</a>
  6. @endif
  7. </div>
  8. </div>
  9. @push('scripts')
  10. <script type="module">
  11. $('a.delete').on('click', function (){
  12. if(confirm('Удалить запись?')) {
  13. $('#{{ $delete['form_id'] ?? 'destroy_form'}}').submit();
  14. }
  15. });
  16. $('.btn').on('click', function (){
  17. $(this).addClass('d-none');
  18. setTimeout(function () {
  19. $('.btn').removeClass('d-none');
  20. },
  21. 2000);
  22. });
  23. </script>
  24. @endpush