Add toasts to UI (#25449)
Fixes https://github.com/go-gitea/gitea/issues/24353 In some case like async success/error, it is useful to show toasts in UI.
This commit is contained in:
parent
72c60f94c1
commit
c71e8abbc3
15 changed files with 220 additions and 20 deletions
|
@ -9,6 +9,7 @@ import {hideElem, showElem, toggleElem} from '../utils/dom.js';
|
|||
import {htmlEscape} from 'escape-goat';
|
||||
import {createTippy} from '../modules/tippy.js';
|
||||
import {confirmModal} from './comp/ConfirmModal.js';
|
||||
import {showErrorToast} from '../modules/toast.js';
|
||||
|
||||
const {appUrl, appSubUrl, csrfToken, i18n} = window.config;
|
||||
|
||||
|
@ -439,7 +440,7 @@ export function initGlobalButtons() {
|
|||
return;
|
||||
}
|
||||
// should never happen, otherwise there is a bug in code
|
||||
alert('Nothing to hide');
|
||||
showErrorToast('Nothing to hide');
|
||||
});
|
||||
|
||||
initGlobalShowModal();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue