MDL-45124 dndupload: Lowercase types when comparing

IE helpfull uses a mixed-case version of 'Text' which fails the string
comparison. All other browsers use lowercase for their mime-types.
This commit is contained in:
Andrew Nicols 2014-04-22 16:07:29 +08:00
parent d55806ce05
commit d2782804cb

View File

@ -232,8 +232,12 @@ M.course_dndupload = {
types_includes: function(e, type) {
var i;
var types = e._event.dataTransfer.types;
type = type.toLowerCase();
for (i=0; i<types.length; i++) {
if (types[i] == type) {
if (!types.hasOwnProperty(i)) {
continue;
}
if (types[i].toLowerCase() === type) {
return true;
}
}