Make sure content is resized after images in content types are laoded. [HFJ-1091]
parent
848a680de4
commit
e0f8afb3f9
|
@ -360,12 +360,21 @@ H5P.QuestionSet = function (options, contentId) {
|
|||
}
|
||||
}
|
||||
|
||||
var registerImageLoadedListener = function (question) {
|
||||
H5P.on(question, 'imageLoaded', function () {
|
||||
self.trigger('resize');
|
||||
});
|
||||
};
|
||||
|
||||
// Attach questions
|
||||
for (var i = 0; i < questionInstances.length; i++) {
|
||||
var question = questionInstances[i];
|
||||
|
||||
question.attach($('.question-container:eq(' + i + ')', $myDom));
|
||||
|
||||
// Listen for image resize
|
||||
registerImageLoadedListener(question);
|
||||
|
||||
// Disable feedback for question
|
||||
question.setBehaviour({disableFeedback: true});
|
||||
|
||||
|
|
Loading…
Reference in New Issue