MDL-29766 Add drag and drop upload to filemanager / filepicker elements
[moodle.git] / lib / form / filepicker.js
index e27d4af..51d8ef6 100644 (file)
@@ -43,4 +43,16 @@ M.form_filepicker.init = function(Y, options) {
     if (item) {
         item.style.display = '';
     }
+
+    var dndoptions = {
+        clientid: options.client_id,
+        acceptedtypes: options.accepted_types,
+        maxfiles: -1,
+        maxbytes: options.maxbytes,
+        itemid: options.itemid,
+        repositories: options.repositories,
+        formcallback: options.formcallback,
+        containerprefix: '#file_info_',
+    };
+    M.form_dndupload.init(Y, dndoptions);
 };