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