mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -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) {
|
export default function clickInit(art, events) {
|
||||||
const { $player } = art.template;
|
const { $player } = art.template;
|
||||||
events.proxy(document, ['click', 'contextmenu'], event => {
|
events.proxy(document, ['click', 'contextmenu'], (event) => {
|
||||||
if (event.composedPath && event.composedPath().indexOf($player) > -1) {
|
if (event.composedPath && event.composedPath().indexOf($player) > -1) {
|
||||||
art.isFocus = true;
|
art.isFocus = true;
|
||||||
art.emit('focus');
|
art.emit('focus');
|
||||||
} else {
|
} else if (art.isFocus) {
|
||||||
art.isFocus = false;
|
art.isFocus = false;
|
||||||
art.emit('blur');
|
art.emit('blur');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user