Manually iterate over DomStringList since chrome and firefox differ on API

(imported from commit fc9c073372f56eb5bcdb463d2d23946df85c4485)
This commit is contained in:
Leo Franchi
2013-04-19 13:26:52 -04:00
parent 1d930e8c43
commit bdcca69233

View File

@@ -89,9 +89,20 @@
function drop(e) {
var i;
function has_type(dom_stringlist, type) {
var j;
for (j = 0; j < dom_stringlist.length; j++) {
if (dom_stringlist[j] === type) {
return true;
}
}
return false;
}
for (i = 0; i < opts.raw_droppable.length; i++) {
var type = opts.raw_droppable[i];
if (e.dataTransfer.types.indexOf(type) > -1) {
if (has_type(e.dataTransfer.types, type)) {
opts.rawDrop(e.dataTransfer.getData(type));
return false;
}