diff --git a/js/youtube.js b/js/youtube.js
index ec8c501a..f64d4874 100644
--- a/js/youtube.js
+++ b/js/youtube.js
@@ -24,12 +24,20 @@
onready(function(){
- $('div.video-container a').click(function() {
- var videoID = $(this.parentNode).data('video');
+ var do_embed_yt = function(tag) {
+ $('div.video-container a', tag).click(function() {
+ var videoID = $(this.parentNode).data('video');
- $(this.parentNode).html('');
+ $(this.parentNode).html('');
- return false;
- });
+ return false;
+ });
+ };
+ do_embed_yt(document);
+
+ // allow to work with auto-reload.js, etc.
+ $(document).bind('new_post', function(e, post) {
+ do_embed_yt(post);
+ });
});