Fix comment event listener

This commit is contained in:
Omar Roth 2019-10-18 12:44:11 -04:00
parent 2a4b252a9d
commit 23ccaea2ff
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2
3 changed files with 175 additions and 169 deletions

View file

@ -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 = '';
}
});