mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
优化blur事件
This commit is contained in:
1 parent
4285201fa9
commit
51bde726ae
1 file changed
+2
-2
@@ -1,10 +1,10 @@
|
||||
export default function clickInit(art, events) {
|
||||
const { $player } = art.template;
|
||||
events.proxy(document, ['click', 'contextmenu'], event => {
|
||||
events.proxy(document, ['click', 'contextmenu'], (event) => {
|
||||
if (event.composedPath && event.composedPath().indexOf($player) > -1) {
|
||||
art.isFocus = true;
|
||||
art.emit('focus');
|
||||
} else {
|
||||
} else if (art.isFocus) {
|
||||
art.isFocus = false;
|
||||
art.emit('blur');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user