From b02fe7c6685663d1e89a33aa2417b438085eb9b7 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Wed, 8 Jul 2015 11:01:20 +0200 Subject: [PATCH] Resize on video loaded and when results are already rendered. --- js/questionset.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index ae0442b..c4602fe 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -234,6 +234,7 @@ H5P.QuestionSet = function (options, contentId) { var _displayEndGame = function () { if (rendered) { $myDom.children().hide().filter('.questionset-results').show(); + self.trigger('resize'); return; } //Remove old score screen. @@ -305,6 +306,10 @@ H5P.QuestionSet = function (options, contentId) { } }); video.attach($videoContainer); + // Resize on video loaded + video.on('loaded', function () { + self.trigger('resize'); + }); video.play(); if (params.endGame.skipButtonText) { @@ -399,7 +404,7 @@ H5P.QuestionSet = function (options, contentId) { if (renderSolutions) { showSolutions(); } - + this.trigger('resize'); return this; @@ -476,4 +481,4 @@ H5P.QuestionSet = function (options, contentId) { } }; H5P.QuestionSet.prototype = Object.create(H5P.EventDispatcher.prototype); -H5P.QuestionSet.prototype.constructor = H5P.QuestionSet; \ No newline at end of file +H5P.QuestionSet.prototype.constructor = H5P.QuestionSet;