From 0fa7ca5c71d13202c99a341a17a6a13735f74e8b Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 15 May 2012 03:17:34 +0530 Subject: [PATCH] optimize instantiation of .pandoravideo()s --- itf/templates/modules/festival/meeting.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/itf/templates/modules/festival/meeting.html b/itf/templates/modules/festival/meeting.html index 86d58dc..f49935f 100755 --- a/itf/templates/modules/festival/meeting.html +++ b/itf/templates/modules/festival/meeting.html @@ -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);