Skip to content

Commit

Permalink
Merge branch 'MDL-62037-35' of https://github.com/lethevinh/moodle in…
Browse files Browse the repository at this point in the history
…to MOODLE_35_STABLE
  • Loading branch information
David Monllao committed Jul 9, 2018
2 parents 771c845 + 23628a9 commit f31105a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions repository/filepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,14 +678,17 @@ M.core_filepicker.init = function(Y, options) {
'repository_id': this.active_repo.id,
'callback': function(id, o, args) {
scope.hide();
// Add an arbitrary parameter to the URL to force browsers to re-load the new image even
// if the file name has not changed.
var urlimage = data.existingfile.url + "?time=" + (new Date()).getTime();
if (scope.options.editor_target && scope.options.env == 'editor') {
// editor needs to update url
scope.options.editor_target.value = data.existingfile.url;
scope.options.editor_target.value = urlimage;
scope.options.editor_target.onchange();
}
var fileinfo = {'client_id':scope.options.client_id,
'url':data.existingfile.url,
'file':data.existingfile.filename};
'url': urlimage,
'file': data.existingfile.filename};
var formcallback_scope = scope.options.magicscope ? scope.options.magicscope : scope;
scope.options.formcallback.apply(formcallback_scope, [fileinfo]);
}
Expand Down

0 comments on commit f31105a

Please sign in to comment.