MDL-29766 Add drag and drop upload to filemanager / filepicker elements
[moodle.git] / lib / form / filemanager.js
index cf6837b..ba2939e 100644 (file)
@@ -763,5 +763,16 @@ M.form_filemanager.init = function(Y, options) {
         item.style.display = '';
     }
 
-    new FileManagerHelper(options);
+    var manager = new FileManagerHelper(options);
+    var dndoptions = {
+        filemanager: manager,
+        acceptedtypes: options.accepted_types,
+        clientid: options.client_id,
+        maxfiles: options.maxfiles,
+        maxbytes: options.maxbytes,
+        itemid: options.itemid,
+        repositories: manager.filepicker_options.repositories,
+        containerprefix: '#filemanager-',
+    };
+    M.form_dndupload.init(Y, dndoptions);
 };