]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fixed reveal closing randomly all .flex-videos from document 4226/head
authorMathieu Amiot <m.amiot@otak-arts.com>
Fri, 24 Jan 2014 01:08:28 +0000 (02:08 +0100)
committerMathieu Amiot <m.amiot@otak-arts.com>
Fri, 24 Jan 2014 01:08:28 +0000 (02:08 +0100)
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

index 6b68b97a68c51940623667a62077846f18126a2e..6699f4c0cd05d1889a5eff54e5d5d899b4c87dc2 100644 (file)
     },
 
     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) {
     },
 
     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) {