From: Mathieu Amiot Date: Fri, 24 Jan 2014 01:08:28 +0000 (+0100) Subject: Fixed reveal closing randomly all .flex-videos from document X-Git-Tag: v5.2.0~72^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4226%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git 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. --- 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) {