Merge branch 'MDL-33758-master-integration' of git://github.com/FMCorz/moodle
authorDan Poltawski <dan@moodle.com>
Fri, 15 Jun 2012 03:30:33 +0000 (11:30 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 15 Jun 2012 03:30:33 +0000 (11:30 +0800)
lib/form/filemanager.js

index 132cbf7..e433d35 100644 (file)
@@ -328,7 +328,6 @@ M.form_filemanager.init = function(Y, options) {
             }
 
             // setup 'download this folder' button
-            // NOTE: popup window must be enabled to perform download process
             button_download.on('click',function(e) {
                 e.preventDefault();
                 var scope = this;
@@ -733,7 +732,13 @@ M.form_filemanager.init = function(Y, options) {
             selectnode.one('.fp-file-download').on('click', function(e) {
                 e.preventDefault();
                 if (this.selectui.fileinfo.type != 'folder') {
-                    window.open(this.selectui.fileinfo.url, 'fm-download-file');
+                    node = Y.Node.create('<iframe></iframe>').setStyles({
+                        visibility : 'hidden',
+                        width : '1px',
+                        height : '1px'
+                    });
+                    node.set('src', this.selectui.fileinfo.url);
+                    Y.one('body').appendChild(node);
                 }
             }, this);
             selectnode.one('.fp-file-delete').on('click', function(e) {