Fix "Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')"
This commit is contained in:
parent
9806afe60f
commit
980a720842
|
@ -131,18 +131,20 @@ if(Auth::user()->id == $userinfo->id){
|
||||||
document.getElementById('logoutForm').submit();
|
document.getElementById('logoutForm').submit();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
@if(auth()->user()->role != 'admin')
|
||||||
function showConfirmation() {
|
<script>
|
||||||
var isConfirmed = confirm("{{__('messages.confirm.delete.user')}}");
|
function showConfirmation() {
|
||||||
if (isConfirmed) {
|
var isConfirmed = confirm("{{__('messages.confirm.delete.user')}}");
|
||||||
window.location.href = document.getElementById("confirmationLink").getAttribute("href");
|
if (isConfirmed) {
|
||||||
}
|
window.location.href = document.getElementById("confirmationLink").getAttribute("href");
|
||||||
}
|
}
|
||||||
document.getElementById("confirmationLink").addEventListener("click", function(event) {
|
}
|
||||||
event.preventDefault();
|
document.getElementById("confirmationLink").addEventListener("click", function(event) {
|
||||||
showConfirmation();
|
event.preventDefault();
|
||||||
});
|
showConfirmation();
|
||||||
</script>
|
});
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
<form id="logoutForm" action="{{ route('logout') }}" method="post">
|
<form id="logoutForm" action="{{ route('logout') }}" method="post">
|
||||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue