From 80c6b0678de2ed35a1d7df69a948e3aea3d9aa87 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 12 Oct 2015 09:22:37 +0200 Subject: [PATCH 1/2] Resize QS container when Q changes size. --- js/questionset.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/questionset.js b/js/questionset.js index d2a5c2f..a31f208 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -110,6 +110,7 @@ H5P.QuestionSet = function (options, contentId) { var questionInstances = []; var $myDom; var scoreBar; + var up; renderSolutions = false; // Instantiate question instances @@ -126,11 +127,21 @@ H5P.QuestionSet = function (options, contentId) { }); } var questionInstance = H5P.newRunnable(question, contentId, undefined, undefined, {parent: self}); + questionInstance.on('resize', function () { + up = true; + self.trigger('resize'); + }); questionInstances.push(questionInstance); } // Resize all interactions on resize self.on('resize', function () { + if (up) { + // Prevent resizing the question again. + up = false; + return; + } + for (var i = 0; i < questionInstances.length; i++) { questionInstances[i].trigger('resize'); } From 7e398ff1da40b0cc727c186fa33ef2c71aaf2923 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 12 Oct 2015 09:24:33 +0200 Subject: [PATCH 2/2] Upped patch version. --- library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.json b/library.json index 15176cb..01aaffc 100644 --- a/library.json +++ b/library.json @@ -4,7 +4,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 5, - "patchVersion": 0, + "patchVersion": 1, "embedTypes": [ "iframe" ],