only allow dropping of files

This commit is contained in:
j 2019-01-24 13:56:59 +05:30
parent ee42cb21dd
commit 4810a7ee97

View file

@ -118,11 +118,15 @@
}); });
Ox.$document.on({ Ox.$document.on({
dragenter: function(event) { dragenter: function(event) {
if (Ox.contains(event.originalEvent.dataTransfer.types, 'Files')) {
event.originalEvent.preventDefault(); event.originalEvent.preventDefault();
event.originalEvent.stopPropagation(); event.originalEvent.stopPropagation();
if (!$('#importScreen').length && !$('#closedScreen').length) { if (!$('#importScreen').length && !$('#closedScreen').length) {
oml.ui.importScreen().appendTo(Ox.$body); oml.ui.importScreen().appendTo(Ox.$body);
} }
} else {
console.log(event.originalEvent.dataTransfer);
}
}, },
dragover: function(event) { dragover: function(event) {
event.originalEvent.preventDefault(); event.originalEvent.preventDefault();