hubl/src/scripts/save-feedback.js
Jean-Baptiste Pasquier 3c54571719 i18n: swal
2021-01-29 14:44:06 +01:00

19 lines
590 B
JavaScript

document.addEventListener("DOMContentLoaded", () => {
const Toast = Swal.mixin({
toast: true,
position: 'top',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
});
document.addEventListener("save", () => {
Toast.fire({
icon: 'success',
title: document.querySelector('#swal-content-text').innerHTML
})
});
});