From 1954a894ec889bdf132cf3b11cc9ffa1cacf6a56 Mon Sep 17 00:00:00 2001 From: Chris Van Date: Wed, 21 Dec 2011 18:07:25 -0500 Subject: [PATCH] fix close button --- media/js/zamboni/discovery_pane.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/media/js/zamboni/discovery_pane.js b/media/js/zamboni/discovery_pane.js index 8598b3df7c..c12711d9a8 100644 --- a/media/js/zamboni/discovery_pane.js +++ b/media/js/zamboni/discovery_pane.js @@ -253,9 +253,14 @@ function initRecs() { $(function() { if(!location.href.match(/en-US/)) return; // US only! + var $learn = $('#learn-more'), + $watch = $('.watch-video'), + $watch_link = $watch.find('a'); + // Make the video clean up after itself. $('#video-close').click(_pd(cleanupVideo)); function cleanupVideo() { + $('.watch-video').show(); $('#sub > section').show(); $('#promo-video-addons').hide(); $('.promo-video, #preload-personas').remove(); @@ -279,20 +284,23 @@ $(function() { 'close': 'Cerrar VĂ­deo'}}; // Hijack the learn more button, why don't we? - var $learn = $('#learn-more'); - if (z.has_addons) { - $('.watch-video').show(); + if ($('#intro').is(':hidden')) { + $watch.show(); } - $('#learn-more, .watch-video:visible').show().addClass('video').click(_pd(function() { + + $('#learn-more, .watch-video:visible a').show().addClass('video').click(_pd(function() { if ($('#main .promo-video:visible').length) { cleanupVideo(); $learn.text($learn.attr('data-oldtext')); + $watch_link.text($watch_link.attr('data-oldtext')); return; } $learn.attr('data-oldtext', $learn.text()); + $watch_link.attr('data-oldtext', $watch_link.text()); // English only. $learn.text('Close Video'); + $watch_link.text('Close Video'); // Make #featured-addons able to handle the animations within it $('#featured-addons').css('overflow', 'hidden');