This commit is contained in:
李万一 2022-10-26 02:34:30 +08:00
parent d7e678b6dd
commit be9e202802
2 changed files with 8 additions and 17 deletions

View File

@ -9,6 +9,7 @@ import WindowActiveState from "../action/WindowActiveState";
export default class Alert extends WuhuBase {
className = 'Alert';
private static container: HTMLElement = null;
private static totalCounter: number = 0;
private notify: MyHTMLElement = null;
private intervalID = -1;
@ -34,6 +35,7 @@ export default class Alert extends WuhuBase {
this.callback = callback || (() => null);
Alert.create(this, msg, timeout || 3);
Alert.totalCounter++;
Log.info('创建新通知:', this, msg);
if (sysNotify) NotificationUtils.getInstance().push(msg, options);
}
@ -53,7 +55,7 @@ export default class Alert extends WuhuBase {
let mouse_enter = false;
element.addEventListener('mouseenter', () => mouse_enter = true, true);
element.addEventListener('mouseleave', () => mouse_enter = false);
// 通知进度条
// 通知进度条 TODO 改进
let progressCount = 101;
// 计时器
that.intervalID = window.setInterval(() => {
@ -83,6 +85,7 @@ export default class Alert extends WuhuBase {
this.notify = null;
this.callback();
window.clearInterval(this.intervalID);
Alert.totalCounter--;
}
public getElement() {

View File

@ -209,22 +209,6 @@ div#wh-popup::after {
display: none !important;
}
/*#wh-gym-info-cont {*/
/* background-color: #363636;*/
/* color: white;*/
/* padding: 8px;*/
/* font-size: 15px;*/
/* border-radius: 4px;*/
/* text-shadow: 0 0 2px black;*/
/* background-image: linear-gradient(90deg, transparent 50%, rgba(0, 0, 0, .07) 0);*/
/* background-size: 4px;*/
/* line-height: 20px;*/
/*}*/
/*#wh-gym-info-cont button {*/
/* cursor: pointer;*/
/*}*/
#wh-notify {
display: inline-block;
position: fixed;
@ -233,8 +217,11 @@ div#wh-popup::after {
width: 360px;
z-index: 9999990;
color: #333;
pointer-events: none;
}
#wh-notify a, #wh-notify button { pointer-events: all; }
#wh-notify a {
color: red;
text-decoration: none;
@ -265,6 +252,7 @@ div#wh-popup::after {
background-size: 100%;
margin: 6px 6px 0 0;
cursor: pointer;
pointer-events: all;
}
#wh-notify .wh-notify-item .wh-notify-msg {