Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-12-14 23:41:58 +01:00
forgejo/web_src/js/standalone/devtest.js
silverwind c71e8abbc3
Add toasts to UI ()
Fixes https://github.com/go-gitea/gitea/issues/24353

In some case like async success/error, it is useful to show toasts in UI.
2023-06-27 02:45:24 +00:00

11 lines
419 B
JavaScript

import {showInfoToast, showWarningToast, showErrorToast} from '../modules/toast.js';
document.getElementById('info-toast').addEventListener('click', () => {
showInfoToast('success 😀');
});
document.getElementById('warning-toast').addEventListener('click', () => {
showWarningToast('warning 😐');
});
document.getElementById('error-toast').addEventListener('click', () => {
showErrorToast('error 🙁');
});