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.
This commit is contained in:
Jake Dallimore
2017-01-10 07:47:18 +08:00
parent 07f6358b03
commit 40b78a23e9
+4
View File
@@ -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);