diff --git a/js/Client/flashMessenger.js b/js/Client/flashMessenger.js index 4dc25f9ff1fb3cb0ac9966084dbc606a889e8910..b28bc2d608f81caf578bbbb287ee5fbc3da04e0f 100644 --- a/js/Client/flashMessenger.js +++ b/js/Client/flashMessenger.js @@ -53,7 +53,7 @@ function removeIcon(message) { } -function toast(message, severity) { +function toast(message, severity, options = null) { const bgClasses = { info: 'bg-info', success: 'bg-success', @@ -111,11 +111,15 @@ function toast(message, severity) { toastContainer().appendChild(toast); // Création et affichage du toast avec bootstrap - const options = { - animation: true, - delay: severity === 'warning' ? 15000 : 5000, - autohide: severity !== 'error' - }; + if(options == null) + { + options = { + animation: true, + delay: severity === 'warning' ? 15000 : 5000, + autohide: severity !== 'error' + }; + } + let bsToast = new bootstrap.Toast(toast, options); bsToast.show(); }