From 8e2349f196b716d3e58071e563eb0666947fc2ec Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Wed, 21 Dec 2016 11:46:04 +0800 Subject: [PATCH] MDL-57480 core_course: make drag and drop fire a dom updated event When adding media via drag and drop, the notifyFilterContentUpdated event should be called after the item is added to the DOM. This allows things like videojs for example, to process the new content. --- course/dndupload.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/course/dndupload.js b/course/dndupload.js index eb759d84738..7c60ee00a1b 100644 --- a/course/dndupload.js +++ b/course/dndupload.js @@ -774,6 +774,10 @@ M.course_dndupload = { resel.li.outerHTML = unescape(resel.li.outerHTML); } self.add_editing(result.elementid); + // Fire the content updated event. + require(['core/event', 'jquery'], function(event, $) { + event.notifyFilterContentUpdated($(result.fullcontent)); + }); } else { // Error - remove the dummy element resel.parent.removeChild(resel.li);