MDL-27919 Fixed a regression where I was seeing that after choosing "Overwrite"
authorJamie Pratt <me@jamiep.org>
Wed, 21 Sep 2011 06:15:23 +0000 (13:15 +0700)
committerJamie Pratt <me@jamiep.org>
Wed, 21 Sep 2011 06:15:23 +0000 (13:15 +0700)
in a filemanager form component when subsequently trying to add another file the
file picker would then immediately close upon opening.

repository/filepicker.js

index ff8a65c..82f60b7 100644 (file)
@@ -211,7 +211,7 @@ M.core_filepicker.init = function(Y, options) {
                         if (scope.options.editor_target && scope.options.env == 'editor') {
                             scope.options.editor_target.value = data.existingfile.url;
                             scope.options.editor_target.onchange();
-                        } else {
+                        } else if (scope.options.env === 'filepicker') {
                             var fileinfo = {'client_id':client_id,
                                     'url':data.existingfile.url,
                                     'file':data.existingfile.filename};