mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
feat: Refactor global event handling in ArtPlayer
- Introduced a new globalInit function to manage document and window events. - Replaced direct event proxies with a unified bindGlobalEvents method. - Updated event handling in various modules to utilize the new global event system. - Removed the deprecated documentInit module. - Bumped version to 5.2.6 in package.json.
This commit is contained in:
1 parent
abd64e11f2
commit
8af6f7c322
18 files changed
+142
-62
No files matched your search
@@ -6,7 +6,7 @@ export default function clickInit(art, events) {
|
||||
template: { $player, $video },
|
||||
} = art
|
||||
|
||||
events.proxy(document, ['click', 'contextmenu'], (event) => {
|
||||
function onDocumentClick(event) {
|
||||
if (includeFromEvent(event, $player)) {
|
||||
art.isInput = event.target.tagName === 'INPUT'
|
||||
art.isFocus = true
|
||||
@@ -17,7 +17,10 @@ export default function clickInit(art, events) {
|
||||
art.isFocus = false
|
||||
art.emit('blur', event)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
art.on('document:click', onDocumentClick)
|
||||
art.on('document:contextmenu', onDocumentClick)
|
||||
|
||||
let clickTimes = []
|
||||
events.proxy($video, 'click', (event) => {
|
||||
|
||||
Reference in new issue
Block a user