fix Ox.UI loader

This commit is contained in:
rlx 2014-09-25 19:08:03 +02:00
parent 61bb4b782e
commit 01f563b102

View file

@ -51,6 +51,13 @@ Ox.load.UI = function(options, callback) {
browserSupported = false,
isInternetExplorer = /MSIE/.test(navigator.userAgent);
browsers.forEach(function(browser) {
var match = browser.regexp && browser.regexp.exec(navigator.userAgent);
if (match && match[1] >= browser.version) {
browserSupported = true;
}
});
Ox.UI = {}; // FIXME: remove
Ox.LoadingScreen = (function() {
@ -198,16 +205,16 @@ Ox.load.UI = function(options, callback) {
return {
hide: function() {
$div.animate({
$screen.animate({
opacity: browserSupported ? 0 : 0.9
}, 1000, function() {
if (browserSupported) {
clearInterval(loadingInterval);
$div.remove();
$screen.remove();
} else {
$div.on({
$screen.on({
click: function() {
$div.remove();
$screen.remove();
}
});
}
@ -220,13 +227,6 @@ Ox.load.UI = function(options, callback) {
}());
browsers.forEach(function(browser) {
var match = browser.regexp && browser.regexp.exec(navigator.userAgent);
if (match && match[1] >= browser.version) {
browserSupported = true;
}
});
Ox.documentReady(function() {
Ox.$('body').addClass('OxTheme' + Ox.toTitleCase(options.theme));
options.showScreen && Ox.LoadingScreen.show();