diff options
author | James Taylor <user234683@users.noreply.github.com> | 2020-09-09 19:00:19 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2020-09-09 19:00:19 -0700 |
commit | 786d3eb445dfa601bcaca8ce7b5688d86a922377 (patch) | |
tree | 2a3322de6e239fb0a1ddd6569c11ba274f07fbd4 /youtube/static/js/hotkeys.js | |
parent | c2ca47c5d3f452f94003d48c661a55685be649d0 (diff) | |
download | yt-local-786d3eb445dfa601bcaca8ce7b5688d86a922377.tar.lz yt-local-786d3eb445dfa601bcaca8ce7b5688d86a922377.tar.xz yt-local-786d3eb445dfa601bcaca8ce7b5688d86a922377.zip |
hotkeys.js: use DOMContentLoaded so images don't delay script
Instead of the load event, which waits until all assets are
finished loading in order for script to start.
Diffstat (limited to 'youtube/static/js/hotkeys.js')
-rw-r--r-- | youtube/static/js/hotkeys.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube/static/js/hotkeys.js b/youtube/static/js/hotkeys.js index 45e4333..c696ac0 100644 --- a/youtube/static/js/hotkeys.js +++ b/youtube/static/js/hotkeys.js @@ -27,6 +27,6 @@ function onKeyDown(e) { } } -window.addEventListener('load', function() { +window.addEventListener('DOMContentLoaded', function() { document.addEventListener('keydown', onKeyDown); -});
\ No newline at end of file +}); |