ui: problem_files: pjax support

This commit is contained in:
undefined committed 2021-05-15 19:02:42 +08:00
1 parent c061c1ec93
commit 3e1d4635c4
16 files changed
+234 -184

No files matched your search

@@ -1,6 +1,19 @@
import { Position, Toaster, Intent } from '@blueprintjs/core';
import tpl from 'vj/utils/tpl';
import zIndexManager from 'vj/utils/zIndexManager';
const ToasterContainer = document.createElement('div');
ToasterContainer.style.position = 'fixed';
ToasterContainer.style.bottom = '0px';
ToasterContainer.style.zIndex = '9999';
document.body.append(ToasterContainer);
export const AppToaster = Toaster.create({
className: 'recipe-toaster',
position: Position.LEFT_BOTTOM,
usePortal: true,
}, ToasterContainer);
export default class Notification {
constructor({
avatar, title, message, type = '', duration = 3000, action,
@@ -37,19 +50,19 @@ export default class Notification {
}
static success(message, duration) {
return new Notification({ type: 'success', message, duration }).show();
return AppToaster.show({ message, timeout: duration, intent: Intent.SUCCESS });
}
static info(message, duration) {
return new Notification({ type: 'info', message, duration }).show();
return AppToaster.show({ message, timeout: duration, intent: Intent.PRIMARY });
}
static warn(message, duration) {
return new Notification({ type: 'warn', message, duration }).show();
return AppToaster.show({ message, timeout: duration, intent: Intent.WARNING });
}
static error(message, duration) {
return new Notification({ type: 'error', message, duration }).show();
return AppToaster.show({ message, timeout: duration, intent: Intent.DANGER });
}
}