From 95358281ef72f487029514527214b15aa6486046 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Sun, 4 Jun 2017 21:54:04 +0200 Subject: [PATCH] fix fullscreen video on click --- .../exposure/templates/gallery-index.html | 22 +++++++++---------- .../templates/sections/bordered-picture.html | 2 +- .../templates/sections/pictures-group.html | 2 +- .../material/templates/gallery-index.html | 22 +++++++++---------- .../templates/sections/bordered-picture.html | 2 +- .../templates/sections/pictures-group.html | 2 +- 6 files changed, 24 insertions(+), 28 deletions(-) diff --git a/prosopopee/themes/exposure/templates/gallery-index.html b/prosopopee/themes/exposure/templates/gallery-index.html index 521e9df..1f5086c 100644 --- a/prosopopee/themes/exposure/templates/gallery-index.html +++ b/prosopopee/themes/exposure/templates/gallery-index.html @@ -79,18 +79,16 @@ $('audio').mediaelementplayer({ }); {% endif %} -var video = $("video"); -video.on('click', function(e){ - var vid = video[0]; - vid.play(); - if (vid.requestFullscreen) { - vid.requestFullscreen(); - } else if (vid.mozRequestFullScreen) { - vid.mozRequestFullScreen(); - } else if (vid.webkitRequestFullscreen) { - vid.webkitRequestFullscreen(); - } -}); +function goFullscreen(id) { + var element = document.getElementById(id); + if (element.requestFullscreen) { + element.requestFullscreen(); + } else if (element.mozRequestFullScreen) { + element.mozRequestFullScreen(); + } else if (element.webkitRequestFullScreen) { + element.webkitRequestFullScreen(); + } +} $(function() { $("img.lazy").lazyload({ diff --git a/prosopopee/themes/exposure/templates/sections/bordered-picture.html b/prosopopee/themes/exposure/templates/sections/bordered-picture.html index c88f415..d1ab5cf 100644 --- a/prosopopee/themes/exposure/templates/sections/bordered-picture.html +++ b/prosopopee/themes/exposure/templates/sections/bordered-picture.html @@ -9,7 +9,7 @@
-