mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51: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
@@ -11,7 +11,7 @@ export default class Hotkey {
|
||||
}
|
||||
|
||||
init() {
|
||||
const { proxy, constructor } = this.art
|
||||
const { constructor } = this.art
|
||||
|
||||
this.add('Escape', () => {
|
||||
if (this.art.fullscreenWeb) {
|
||||
@@ -39,7 +39,7 @@ export default class Hotkey {
|
||||
this.art.volume -= constructor.VOLUME_STEP
|
||||
})
|
||||
|
||||
proxy(document, 'keydown', (event) => {
|
||||
this.art.on('document:keydown', (event) => {
|
||||
if (this.art.isFocus) {
|
||||
const tag = document.activeElement.tagName.toUpperCase()
|
||||
const editable = document.activeElement.getAttribute('contenteditable')
|
||||
|
||||
Reference in new issue
Block a user