Skip to content

Commit

Permalink
Fix compatibility with newer jQuery versions
Browse files Browse the repository at this point in the history
  • Loading branch information
icc committed May 18, 2020
1 parent 3fd5373 commit 757f705
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/h5peditor-av.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -589,7 +589,7 @@ H5PEditor.widgets.video = H5PEditor.widgets.audio = H5PEditor.AV = (function ($)
const id = 'av-upload-' + C.getNextId();
return '<h3 id="' + id + '">' + H5PEditor.t('core', isAudio ? 'uploadAudioTitle' : 'uploadVideoTitle') + '</h3>' +
'<div class="h5p-file-drop-upload" tabindex="0" role="button" aria-labelledby="' + id + '">' +
'<div class="h5p-file-drop-upload-inner ' + type + '"/>' +
'<div class="h5p-file-drop-upload-inner ' + type + '"></div>' +
'</div>';

case 'InputLinkURL':
Expand Down
2 changes: 1 addition & 1 deletion scripts/h5peditor-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?)
Expand Down
2 changes: 1 addition & 1 deletion scripts/h5peditor-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 757f705

Please sign in to comment.