Commit 2cde5763 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Permettre de surcharger les options par defaut du toast dans unicaenvue

parent 8e456cdb
Loading
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -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 = {
    if(options == null)
    {
        options = {
            animation: true,
            delay: severity === 'warning' ? 15000 : 5000,
            autohide: severity !== 'error'
        };
    }

    let bsToast = new bootstrap.Toast(toast, options);
    bsToast.show();
}