diff --git a/static/js/oml.js b/static/js/oml.js index d5b8ea2..7204060 100644 --- a/static/js/oml.js +++ b/static/js/oml.js @@ -96,14 +96,21 @@ }); Ox.$document.on({ dragenter: function(event) { - event.preventDefault(); + event.originalEvent.preventDefault(); + event.originalEvent.stopPropagation(); + if (!$('#importScreen').length) { + oml.ui.importScreen().appendTo(Ox.$body); + } }, dragover: function(event) { - event.preventDefault(); + event.originalEvent.preventDefault(); + event.originalEvent.stopPropagation(); }, drop: function(event) { + $('#importScreen').remove(); if (event.originalEvent.dataTransfer.files) { - event.preventDefault(); + event.originalEvent.preventDefault(); + event.originalEvent.stopPropagation(); oml.upload(event.originalEvent.dataTransfer.files, function(response) { setTimeout(function() { Ox.Request.clearCache(); @@ -132,24 +139,12 @@ removeScreen(); oml.bindEvent({ close: function() { - if(!$('#offline').length) { - $('
') - .attr({id: 'offline'}) - .css({ - left: 0, - right: 0, - top: 0, - bottom: 0, - position: 'absolute', - opacity: 0.5, - backgroundColor: 'black', - zIndex: 1000 - }) - .appendTo(Ox.$body); + if (!$('#closedScreen').length) { + oml.ui.closedScreen().appendTo(Ox.$body); } }, open: function() { - $('#offline').remove(); + $('#closedScreen').remove(); } }); });