From b4bd0f47438205c25475849f4e58fb48d990ca3a Mon Sep 17 00:00:00 2001 From: Mathieu Amiot Date: Fri, 24 Jan 2014 02:08:28 +0100 Subject: [PATCH] Fixed reveal closing randomly all .flex-videos from document In the context of the function, this refers to document, so when you do $(document).find('.flex-video') and then set the iframe src to about:blank, all videos on the website are dying. The huge problem is that this method is also called by alert-boxes, dropdowns and so on. --- js/foundation/foundation.reveal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/foundation/foundation.reveal.js b/js/foundation/foundation.reveal.js index 6b68b97a6..6699f4c0c 100644 --- a/js/foundation/foundation.reveal.js +++ b/js/foundation/foundation.reveal.js @@ -349,7 +349,7 @@ }, close_video : function (e) { - var video = $(this).find('.flex-video'), + var video = $(e.target).find('.flex-video'), iframe = video.find('iframe'); if (iframe.length > 0) { @@ -360,7 +360,7 @@ }, open_video : function (e) { - var video = $(this).find('.flex-video'), + var video = $(e.target).find('.flex-video'), iframe = video.find('iframe'); if (iframe.length > 0) { -- 2.47.2