use new screens

This commit is contained in:
rlx 2016-01-12 13:09:40 +05:30
parent df22047962
commit 85bdb00572

View file

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