From 68462880996b4d3a600a7080e6bf28fb04ec990b Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Mon, 11 Aug 2014 16:27:23 +0200 Subject: [PATCH] Fixed broken fullscreen on YouTube player. --- static/js/directives/youtubevideo.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/static/js/directives/youtubevideo.js b/static/js/directives/youtubevideo.js index 7b2aff0f..e1e739aa 100644 --- a/static/js/directives/youtubevideo.js +++ b/static/js/directives/youtubevideo.js @@ -544,11 +544,23 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'], } }); + $scope.toggleFullscreen = function(elem) { + + if (BigScreen.enabled) { + if (elem) { + BigScreen.toggle(elem); + } else { + BigScreen.toggle(pane.get(0)); + } + } + + }; + }]; var compile = function(tElement, tAttr) { return function(scope, iElement, iAttrs, controller) { - $(iElement).on("dblclick", ".videoContainer", _.debounce(function(event) { + $(iElement).on("dblclick", "#youtubecontainer", _.debounce(function(event) { scope.toggleFullscreen(event.delegateTarget); }, 100, true)); }