file drop improvements

This commit is contained in:
rlx 2016-01-12 13:27:09 +05:30
parent 6274ae08ea
commit 61fe4d2805

View file

@ -98,7 +98,7 @@
dragenter: function(event) { dragenter: function(event) {
event.originalEvent.preventDefault(); event.originalEvent.preventDefault();
event.originalEvent.stopPropagation(); event.originalEvent.stopPropagation();
if (!$('#importScreen').length) { if (!$('#importScreen').length && !$('closedScreen').length) {
oml.ui.importScreen().appendTo(Ox.$body); oml.ui.importScreen().appendTo(Ox.$body);
} }
}, },
@ -106,6 +106,10 @@
event.originalEvent.preventDefault(); event.originalEvent.preventDefault();
event.originalEvent.stopPropagation(); event.originalEvent.stopPropagation();
}, },
dragstart: function(event) {
event.originalEvent.preventDefault();
event.originalEvent.stopPropagation();
},
drop: function(event) { drop: function(event) {
$('#importScreen').remove(); $('#importScreen').remove();
if (event.originalEvent.dataTransfer.files) { if (event.originalEvent.dataTransfer.files) {