optimize instantiation of .pandoravideo()s
This commit is contained in:
parent
ff4a28b8b2
commit
0fa7ca5c71
|
@ -250,13 +250,24 @@
|
|||
(function() {
|
||||
var $video;
|
||||
$('.padmaVideo').hide();
|
||||
/*
|
||||
$('.padmaVideo').each(function() {
|
||||
$(this).pandoravideo();
|
||||
});
|
||||
*/
|
||||
$('a.padmaLink').toggle(function() {
|
||||
var index = $(this).index('.padmaLink');
|
||||
var $video = $('.padmaVideo').eq(index);
|
||||
$video.slideDown();
|
||||
if ($video.data("padmaLoaded")) {
|
||||
$video.slideDown();
|
||||
} else {
|
||||
$video.text("Loading video...");
|
||||
$video.pandoravideo({
|
||||
callback: function(videoObject) {
|
||||
$video.data("padmaLoaded", true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, function() {
|
||||
var index = $(this).index('.padmaLink');
|
||||
var $video = $('.padmaVideo').eq(index);
|
||||
|
|
Loading…
Reference in New Issue
Block a user