reload if backend was already done

This commit is contained in:
j 2016-01-13 11:47:46 +05:30
parent 2e60ade8ff
commit fb51189d15

View file

@ -89,7 +89,11 @@
color: '#999999' color: '#999999'
}).appendTo(Ox.$('#loadingScreen')); }).appendTo(Ox.$('#loadingScreen'));
oml.ui.status.html('Updating Open Media Library...'); oml.ui.status.html('Updating Open Media Library...');
oml.reload = true; oml.down = setTimeout(function() {
if (oml.socket.readyState != oml.socket.OPEN && Ox.isUndefined(oml.reload)) {
reload();
}
}, 5000);
}, },
updatestatus: function(data) { updatestatus: function(data) {
oml.ui.status.html(data.status); oml.ui.status.html(data.status);
@ -98,9 +102,8 @@
close: function(data) { close: function(data) {
}, },
open: function(data) { open: function(data) {
Ox.print('socket open');
if (oml.reload) { if (oml.reload) {
document.location.href = document.location.protocol + '//' + document.location.host; reload();
} }
} }
}); });
@ -146,6 +149,10 @@
document.body && window.onload(); document.body && window.onload();
} }
function reload() {
document.location.href = document.location.protocol + '//' + document.location.host;
}
function removeScreen() { function removeScreen() {
var $loadingScreen = $('#loadingScreen'); var $loadingScreen = $('#loadingScreen');
$loadingScreen.animate({ $loadingScreen.animate({