Merge branch 'bugfix/notifications' into 'master'

[notify] fixed warning and info popups

See merge request fronk/thetool!307
This commit is contained in:
Luca Haid
2024-04-02 14:44:44 +00:00
+15 -4
View File
@@ -6,9 +6,19 @@ document.addEventListener('DOMContentLoaded', () => {
// @formatter:on // @formatter:on
const notyf = new Notyf({ const notyf = new Notyf({
duration: 10000 * 1000, position: { duration: 10000, position: {
x: 'right', y: 'bottom', x: 'right', y: 'bottom',
}, ripple: true, dismissible: true, fontSize: '32px', }, ripple: true, dismissible: true, fontSize: '32px',
types: [{
type: "info",
backgroundColor: "#17a2b8",
icon: {className: "fa fa-info-circle text-white",tagName: "i"}
},
{
type: 'warning',
backgroundColor: '#ffc107',
icon: {className: 'fa fa-exclamation-triangle text-white',tagName: 'i',},
}]
}); });
/** /**
@@ -22,13 +32,14 @@ document.addEventListener('DOMContentLoaded', () => {
notyf.success(text); notyf.success(text);
break; break;
case 'info': case 'info':
notyf.info(text); notyf.open({type: 'info', message: text});
break; break;
case 'warning': case 'warning':
notyf.warning(text); notyf.open({type: 'warning', message: text});
break; break;
case'warn': case'warn':
notyf.warning(text); notyf.open({type: 'warning', message: text});
break;
case 'error': case 'error':
notyf.error(text); notyf.error(text);
break; break;