Skip to content

Commit

Permalink
Fix image resizing on image loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Dec 12, 2019
1 parent 665f081 commit e9e1aa7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions h5p-accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}

Expand Down

0 comments on commit e9e1aa7

Please sign in to comment.