optimize instantiation of .pandoravideo()s
This commit is contained in:
parent
ff4a28b8b2
commit
0fa7ca5c71
|
@ -250,13 +250,24 @@
|
||||||
(function() {
|
(function() {
|
||||||
var $video;
|
var $video;
|
||||||
$('.padmaVideo').hide();
|
$('.padmaVideo').hide();
|
||||||
|
/*
|
||||||
$('.padmaVideo').each(function() {
|
$('.padmaVideo').each(function() {
|
||||||
$(this).pandoravideo();
|
$(this).pandoravideo();
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
$('a.padmaLink').toggle(function() {
|
$('a.padmaLink').toggle(function() {
|
||||||
var index = $(this).index('.padmaLink');
|
var index = $(this).index('.padmaLink');
|
||||||
var $video = $('.padmaVideo').eq(index);
|
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() {
|
}, function() {
|
||||||
var index = $(this).index('.padmaLink');
|
var index = $(this).index('.padmaLink');
|
||||||
var $video = $('.padmaVideo').eq(index);
|
var $video = $('.padmaVideo').eq(index);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user