From 01f563b1023e2339f68e3c74b72be647811a5c25 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 25 Sep 2014 19:08:03 +0200 Subject: [PATCH] fix Ox.UI loader --- source/Ox.UI/Ox.UI.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/Ox.UI/Ox.UI.js b/source/Ox.UI/Ox.UI.js index 573f6e4c..9729c737 100644 --- a/source/Ox.UI/Ox.UI.js +++ b/source/Ox.UI/Ox.UI.js @@ -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();