function toast(title, message, type) { let toastrPosition = $(window).width() < 578 ? "toast-top-right" : "toast-bottom-right"; toastr.options = { debug: false, positionClass: toastrPosition, onclick: null, fadeIn: 300, fadeOut: 1000, timeOut: 5000, preventDuplicates: true, extendedTimeOut: 1000 } if (type == 'danger'){ return toastr.error(message, title); } return toastr.success(message, title); }