mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
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:
parent
d55806ce05
commit
d2782804cb
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user