diff --git a/scripts/h5peditor-av.js b/scripts/h5peditor-av.js index b2e097b2c9298e6eacdc905b28b95b8a92c3ba7e..84b26b214ad81437ce7ce2d0748ec175ba806e84 100644 --- a/scripts/h5peditor-av.js +++ b/scripts/h5peditor-av.js @@ -119,8 +119,8 @@ H5PEditor.widgets.video = H5PEditor.widgets.audio = H5PEditor.AV = (function ($) '</div>'; var html = H5PEditor.createFieldMarkup(this.field, imageHtml, id); - var $container = $(html).appendTo($wrapper); + this.$files = $container.children('.file'); this.$add = $container.children('.h5p-add-file').click(function () { self.$addDialog.addClass('h5p-open'); @@ -587,7 +587,7 @@ H5PEditor.widgets.video = H5PEditor.widgets.audio = H5PEditor.AV = (function ($) const id = 'av-upload-' + C.getNextId(); return '<h3 id="' + id + '">' + H5PEditor.t('core', type === 'audio' ? 'uploadAudioTitle' : 'uploadVideoTitle') + '</h3>' + '<div class="h5p-file-drop-upload" tabindex="0" role="button" aria-labelledby="' + id + '">' + - '<div class="h5p-file-drop-upload-inner"/>' + + '<div class="h5p-file-drop-upload-inner ' + type + '"></div>' + '</div>'; case 'InputLinkURL': diff --git a/scripts/h5peditor-editor.js b/scripts/h5peditor-editor.js index bcfa90d8f67b92c26cddaa2c12622237ff390b5a..d9d4a37884df1a5c68159e537c29751931c29055 100644 --- a/scripts/h5peditor-editor.js +++ b/scripts/h5peditor-editor.js @@ -230,7 +230,7 @@ ns.Editor = function (library, defaultParams, replace, iframeLoaded) { // Need to put this after the above replaceAll(), since that one makes Safari // 11 trigger a load event for the iframe - $iframe.load(load); + $iframe.on('load', load); // Populate iframe with the H5P Editor // (should not really be done until 'load', but might be here in case the iframe is reloaded?) diff --git a/scripts/h5peditor-group.js b/scripts/h5peditor-group.js index 47d26d8d09135a4577fdc746d25b708da007278d..2c15696032872328b55522b5dfb8734b003e8c19 100644 --- a/scripts/h5peditor-group.js +++ b/scripts/h5peditor-group.js @@ -313,7 +313,7 @@ ns.Group.prototype.setSummary = function (summary) { // Parse html var summaryTextNode = ns.$.parseHTML(summary); - if (summaryTextNode !== null) { + if (summaryTextNode !== null && summaryTextNode.length) { summaryText = summaryTextNode[0].nodeValue; }