From 5b54a1c726bd97fcb29daa3063d8a0d3ade7a2d6 Mon Sep 17 00:00:00 2001 From: Nathan Nguyen Date: Thu, 12 Sep 2019 10:26:24 +1000 Subject: [PATCH] MDL-64917 filepicker: change event dispatch --- repository/filepicker.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/repository/filepicker.js b/repository/filepicker.js index d273aa5ce05..934085f2e07 100644 --- a/repository/filepicker.js +++ b/repository/filepicker.js @@ -683,7 +683,7 @@ M.core_filepicker.init = function(Y, options) { if (scope.options.editor_target && scope.options.env == 'editor') { // editor needs to update url scope.options.editor_target.value = urlimage; - scope.options.editor_target.onchange(); + scope.options.editor_target.dispatchEvent(new Event('change'), {'bubbles': true}); } var fileinfo = {'client_id':scope.options.client_id, 'url': urlimage, @@ -700,7 +700,7 @@ M.core_filepicker.init = function(Y, options) { var data = this.process_dlg.dialogdata; if (scope.options.editor_target && scope.options.env == 'editor') { scope.options.editor_target.value = data.newfile.url; - scope.options.editor_target.onchange(); + scope.options.editor_target.dispatchEvent(new Event('change'), {'bubbles': true}); } scope.hide(); var formcallback_scope = scope.options.magicscope ? scope.options.magicscope : scope; @@ -1235,7 +1235,7 @@ M.core_filepicker.init = function(Y, options) { } if (scope.options.editor_target && scope.options.env=='editor') { scope.options.editor_target.value=obj.url; - scope.options.editor_target.onchange(); + scope.options.editor_target.dispatchEvent(new Event('change'), {'bubbles': true}); } scope.hide(); obj.client_id = client_id; @@ -1803,7 +1803,7 @@ M.core_filepicker.init = function(Y, options) { } if (scope.options.editor_target&&scope.options.env=='editor') { scope.options.editor_target.value=o.url; - scope.options.editor_target.onchange(); + scope.options.editor_target.dispatchEvent(new Event('change'), {'bubbles': true}); } scope.hide(); o.client_id = client_id;