Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const showConfirmationDialog = element => {
Notifications.confirm(
element.getAttribute('data-text'),
result => confirmed(element, result)
)
}
const confirmed = (element, result) => {
if (result.value) {
element.removeAttribute('data-confirm-swal')
element.click()
}
}
Rails.delegate(document, 'a[data-confirm-swal]', 'click', handleConfirm)
Rails.start()
smoothscroll.polyfill()