From e9e1aa776c8940f94563acd9a0561d14a8e22da8 Mon Sep 17 00:00:00 2001 From: otacke Date: Fri, 9 Aug 2019 12:56:57 +0200 Subject: [PATCH] Fix image resizing on image loaded --- h5p-accordion.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/h5p-accordion.js b/h5p-accordion.js index a9a7f29..5165588 100644 --- a/h5p-accordion.js +++ b/h5p-accordion.js @@ -42,10 +42,12 @@ H5P.Accordion = (function ($) { var currentContent = this.params.panels[i].contents[j]; this.panels[i].instances[j] = H5P.newRunnable(currentContent, contentId); + var currentLibrary = currentContent.library.split(' ')[0]; + // Resize images when loaded - if (currentContent.library === 'H5P.Image') { + if (currentLibrary === 'H5P.Image') { this.panels[i].instances[j].on('loaded', function () { - self.trigger('resize'); + this.trigger('resize'); }); }