Skip to content
Snippets Groups Projects
Unverified Commit 3b4e867e authored by Frode Petterson's avatar Frode Petterson Committed by Thomas Marstrander
Browse files

Fix compatibility with newer jQuery versions

(cherry picked from commit 757f7053)
parent 687c698e
No related branches found
No related tags found
No related merge requests found
...@@ -119,8 +119,8 @@ H5PEditor.widgets.video = H5PEditor.widgets.audio = H5PEditor.AV = (function ($) ...@@ -119,8 +119,8 @@ H5PEditor.widgets.video = H5PEditor.widgets.audio = H5PEditor.AV = (function ($)
'</div>'; '</div>';
var html = H5PEditor.createFieldMarkup(this.field, imageHtml, id); var html = H5PEditor.createFieldMarkup(this.field, imageHtml, id);
var $container = $(html).appendTo($wrapper); var $container = $(html).appendTo($wrapper);
this.$files = $container.children('.file'); this.$files = $container.children('.file');
this.$add = $container.children('.h5p-add-file').click(function () { this.$add = $container.children('.h5p-add-file').click(function () {
self.$addDialog.addClass('h5p-open'); self.$addDialog.addClass('h5p-open');
...@@ -587,7 +587,7 @@ H5PEditor.widgets.video = H5PEditor.widgets.audio = H5PEditor.AV = (function ($) ...@@ -587,7 +587,7 @@ H5PEditor.widgets.video = H5PEditor.widgets.audio = H5PEditor.AV = (function ($)
const id = 'av-upload-' + C.getNextId(); const id = 'av-upload-' + C.getNextId();
return '<h3 id="' + id + '">' + H5PEditor.t('core', type === 'audio' ? 'uploadAudioTitle' : 'uploadVideoTitle') + '</h3>' + 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" tabindex="0" role="button" aria-labelledby="' + id + '">' +
'<div class="h5p-file-drop-upload-inner"/>' + '<div class="h5p-file-drop-upload-inner ' + type + '"></div>' +
'</div>'; '</div>';
case 'InputLinkURL': case 'InputLinkURL':
......
...@@ -230,7 +230,7 @@ ns.Editor = function (library, defaultParams, replace, iframeLoaded) { ...@@ -230,7 +230,7 @@ ns.Editor = function (library, defaultParams, replace, iframeLoaded) {
// Need to put this after the above replaceAll(), since that one makes Safari // Need to put this after the above replaceAll(), since that one makes Safari
// 11 trigger a load event for the iframe // 11 trigger a load event for the iframe
$iframe.load(load); $iframe.on('load', load);
// Populate iframe with the H5P Editor // Populate iframe with the H5P Editor
// (should not really be done until 'load', but might be here in case the iframe is reloaded?) // (should not really be done until 'load', but might be here in case the iframe is reloaded?)
......
...@@ -313,7 +313,7 @@ ns.Group.prototype.setSummary = function (summary) { ...@@ -313,7 +313,7 @@ ns.Group.prototype.setSummary = function (summary) {
// Parse html // Parse html
var summaryTextNode = ns.$.parseHTML(summary); var summaryTextNode = ns.$.parseHTML(summary);
if (summaryTextNode !== null) { if (summaryTextNode !== null && summaryTextNode.length) {
summaryText = summaryTextNode[0].nodeValue; summaryText = summaryTextNode[0].nodeValue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment