Version 0.7.0 #1
16
resources/views/private/_scripts/_click-confirm.blade.php
Normal file
16
resources/views/private/_scripts/_click-confirm.blade.php
Normal file
@ -0,0 +1,16 @@
|
||||
<script>
|
||||
(function() {
|
||||
function clickConfirmAddEventListener(element, index, array) {
|
||||
element.addEventListener('click', (e) => {
|
||||
const result = confirm('{{ $alert }}');
|
||||
if (! result) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
let clickConfirm = document.querySelectorAll('.click-confirm');
|
||||
if (clickConfirm.length > 0) {
|
||||
clickConfirm.forEach(clickConfirmAddEventListener);
|
||||
}
|
||||
})();
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user