Skip to content

Commit

Permalink
MDL-33719 When overwriting a file the filemanager is not refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy authored and stronk7 committed May 22, 2013
1 parent 91af4fa commit d95506e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions repository/filepicker.js
Expand Up @@ -662,18 +662,16 @@ M.core_filepicker.init = function(Y, options) {
'repository_id': this.active_repo.id, 'repository_id': this.active_repo.id,
'callback': function(id, o, args) { 'callback': function(id, o, args) {
scope.hide(); scope.hide();
// editor needs to update url
// filemanager do nothing
if (scope.options.editor_target && scope.options.env == 'editor') { 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 = data.existingfile.url;
scope.options.editor_target.onchange(); scope.options.editor_target.onchange();
} else if (scope.options.env === 'filepicker') {
var fileinfo = {'client_id':scope.options.client_id,
'url':data.existingfile.url,
'file':data.existingfile.filename};
var formcallback_scope = scope.options.magicscope ? scope.options.magicscope : scope;
scope.options.formcallback.apply(formcallback_scope, [fileinfo]);
} }
var fileinfo = {'client_id':scope.options.client_id,
'url':data.existingfile.url,
'file':data.existingfile.filename};
var formcallback_scope = scope.options.magicscope ? scope.options.magicscope : scope;
scope.options.formcallback.apply(formcallback_scope, [fileinfo]);
} }
}, true); }, true);
} }
Expand Down

0 comments on commit d95506e

Please sign in to comment.