mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-12 15:26:16 -08:00
13 lines
413 B
JavaScript
13 lines
413 B
JavaScript
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');
|
|
} else if (art.isFocus) {
|
|
art.isFocus = false;
|
|
art.emit('blur');
|
|
}
|
|
});
|
|
}
|