MDL-46834 dndupload: Hide dnd message when user cant upload files
authorMarina Glancy <marina@moodle.com>
Thu, 4 Sep 2014 07:46:20 +0000 (15:46 +0800)
committerMarina Glancy <marina@moodle.com>
Tue, 9 Sep 2014 02:02:25 +0000 (10:02 +0800)
lib/form/dndupload.js

index 60b78bb..b53446d 100644 (file)
@@ -83,15 +83,17 @@ M.form_dndupload.init = function(Y, options) {
                 Y.one('body').addClass('dndnotsupported');
                 return; // Browser does not support the required functionality
             }
-            Y.one('body').addClass('dndsupported');
 
             // try and retrieve enabled upload repository
             this.repositoryid = this.get_upload_repositoryid(options.repositories);
 
             if (!this.repositoryid) {
+                Y.one('body').addClass('dndnotsupported');
                 return; // no upload repository is enabled to upload to
             }
 
+            Y.one('body').addClass('dndsupported');
+
             this.options = options;
             this.acceptedtypes = options.acceptedtypes;
             this.clientid = options.clientid;