youtube.js: make it work with thread expand etc.
This commit is contained in:
parent
ede654cbd8
commit
d31be1958d
@ -24,12 +24,20 @@
|
|||||||
|
|
||||||
|
|
||||||
onready(function(){
|
onready(function(){
|
||||||
$('div.video-container a').click(function() {
|
var do_embed_yt = function(tag) {
|
||||||
var videoID = $(this.parentNode).data('video');
|
$('div.video-container a', tag).click(function() {
|
||||||
|
var videoID = $(this.parentNode).data('video');
|
||||||
|
|
||||||
$(this.parentNode).html('<iframe style="float:left;margin: 10px 20px" type="text/html" width="360" height="270" src="//www.youtube.com/embed/' + videoID + '?autoplay=1" frameborder="0"/>');
|
$(this.parentNode).html('<iframe style="float:left;margin: 10px 20px" type="text/html" width="360" height="270" src="//www.youtube.com/embed/' + videoID + '?autoplay=1" frameborder="0"/>');
|
||||||
|
|
||||||
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user