削除確認モーダルのsubmit処理を変更
This commit is contained in:
parent
2f928a29e1
commit
969bc79cbc
@ -16,14 +16,17 @@ $('.copy-to-clipboard').on('shown.bs.popover', function () {
|
|||||||
setTimeout(() => $(this).popover('hide'), 3000);
|
setTimeout(() => $(this).popover('hide'), 3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
const $deleteModal = $('#deleteIncomingWebhookModal');
|
const deleteModal = document.getElementById('deleteIncomingWebhookModal');
|
||||||
$deleteModal.find('.btn-danger').on('click', function () {
|
if (deleteModal) {
|
||||||
const $form = $deleteModal.find('form');
|
let id: any = null;
|
||||||
$form.attr('action', $form.attr('action')?.replace('@', $deleteModal.data('id')) || null);
|
deleteModal.querySelector('form')?.addEventListener('submit', function () {
|
||||||
$form.submit();
|
this.action = this.action.replace('@', id);
|
||||||
});
|
});
|
||||||
$('[data-target="#deleteIncomingWebhookModal"]').on('click', function (event) {
|
document.querySelectorAll<HTMLElement>('[data-target="#deleteIncomingWebhookModal"]').forEach((el) => {
|
||||||
event.preventDefault();
|
el.addEventListener('click', function (e) {
|
||||||
$deleteModal.data('id', $(this).data('id'));
|
e.preventDefault();
|
||||||
$deleteModal.modal('show', this);
|
id = this.dataset.id;
|
||||||
});
|
$(deleteModal).modal('show', this);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -54,13 +54,13 @@
|
|||||||
削除確認
|
削除確認
|
||||||
@endslot
|
@endslot
|
||||||
Webhookを削除してもよろしいですか?
|
Webhookを削除してもよろしいですか?
|
||||||
<form action="{{ route('setting.webhooks.destroy', ['webhook' => '@']) }}" method="post">
|
|
||||||
{{ csrf_field() }}
|
|
||||||
{{ method_field('DELETE') }}
|
|
||||||
</form>
|
|
||||||
@slot('footer')
|
@slot('footer')
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">キャンセル</button>
|
<form action="{{ route('setting.webhooks.destroy', ['webhook' => '@']) }}" method="post">
|
||||||
<button type="button" class="btn btn-danger">削除</button>
|
{{ csrf_field() }}
|
||||||
|
{{ method_field('DELETE') }}
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">キャンセル</button>
|
||||||
|
<button type="submit" class="btn btn-danger">削除</button>
|
||||||
|
</form>
|
||||||
@endslot
|
@endslot
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endsection
|
@endsection
|
||||||
|
Loading…
Reference in New Issue
Block a user