调整整体样式

This commit is contained in:
Harvey Zack committed 2019-04-30 15:10:30 +08:00
1 parent 487e865017
commit fa585e536a
49 files changed
+984 -322

No files matched your search

+8 -8
View File
@@ -1,5 +1,3 @@
import { setStyle } from './utils';
export default class Notice {
constructor(art) {
this.art = art;
@@ -7,8 +5,9 @@ export default class Notice {
}
show(msg, autoHide = true, time = 1000) {
const { $notice, $noticeInner } = this.art.template;
setStyle($notice, 'display', 'block');
const { $player, $noticeInner } = this.art.template;
this.state = true;
$player.classList.add('artplayer-notice-show');
$noticeInner.innerHTML = msg instanceof Error ? msg.message.trim() : msg;
clearTimeout(this.timer);
if (autoHide) {
@@ -16,12 +15,13 @@ export default class Notice {
this.hide();
}, time);
}
this.art.emit('notice:show', $notice);
this.art.emit('notice:show');
}
hide() {
const { $notice } = this.art.template;
setStyle($notice, 'display', 'none');
this.art.emit('notice:hide', $notice);
const { $player } = this.art.template;
this.state = false;
$player.classList.remove('artplayer-notice-show');
this.art.emit('notice:hide');
}
}