fix notice not display when error event triggered

This commit is contained in:
DIYgod 2018-07-05 00:14:56 +08:00
parent 046e8ee6b4
commit bad2200611
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67

View File

@ -545,10 +545,12 @@ class DPlayer {
clearTimeout(this.noticeTime);
}
this.events.trigger('notice_show', text);
this.noticeTime = setTimeout(() => {
this.template.notice.style.opacity = 0;
this.events.trigger('notice_hide');
}, time);
if (time > 0) {
this.noticeTime = setTimeout(() => {
this.template.notice.style.opacity = 0;
this.events.trigger('notice_hide');
}, time);
}
}
resize () {