diff options
| author | Omar Roth <omarroth@protonmail.com> | 2019-10-18 12:44:11 -0400 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2019-10-18 12:44:11 -0400 |
| commit | 23ccaea2ff30fa97c92a05343141ce1fc4d08dd1 (patch) | |
| tree | 926efe5e3c8195b7f3d4f732d6c99e3bee538b11 /assets/js/watch.js | |
| parent | 2a4b252a9d2d163150d8ad46f44b3931dfc0f16b (diff) | |
| download | invidious-23ccaea2ff30fa97c92a05343141ce1fc4d08dd1.tar.gz invidious-23ccaea2ff30fa97c92a05343141ce1fc4d08dd1.tar.bz2 invidious-23ccaea2ff30fa97c92a05343141ce1fc4d08dd1.zip | |
Fix comment event listener
Diffstat (limited to '')
| -rw-r--r-- | assets/js/watch.js | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/assets/js/watch.js b/assets/js/watch.js index 80cb1769..a26cb505 100644 --- a/assets/js/watch.js +++ b/assets/js/watch.js @@ -439,19 +439,21 @@ if (video_data.play_next) { }); } -if (video_data.plid) { - get_playlist(video_data.plid); -} +window.addEventListener('load', function (e) { + if (video_data.plid) { + get_playlist(video_data.plid); + } -if (video_data.params.comments[0] === 'youtube') { - get_youtube_comments(); -} else if (video_data.params.comments[0] === 'reddit') { - get_reddit_comments(); -} else if (video_data.params.comments[1] === 'youtube') { - get_youtube_comments(); -} else if (video_data.params.comments[1] === 'reddit') { - get_reddit_comments(); -} else { - comments = document.getElementById('comments'); - comments.innerHTML = ''; -} + if (video_data.params.comments[0] === 'youtube') { + get_youtube_comments(); + } else if (video_data.params.comments[0] === 'reddit') { + get_reddit_comments(); + } else if (video_data.params.comments[1] === 'youtube') { + get_youtube_comments(); + } else if (video_data.params.comments[1] === 'reddit') { + get_reddit_comments(); + } else { + comments = document.getElementById('comments'); + comments.innerHTML = ''; + } +}); |
