diff --git a/source/js/Ox.UI/Ox.UI.js b/source/js/Ox.UI/Ox.UI.js index 823adbb1..f2bca1f4 100644 --- a/source/js/Ox.UI/Ox.UI.js +++ b/source/js/Ox.UI/Ox.UI.js @@ -26,10 +26,13 @@ Ox.load.UI = function(options, callback) { version: 5 } ], - browserSupported = false; + browserSupported = false, + loadingInterval; browsers.forEach(function(browser) { - var match = browser.regexp(navigator.userAgent); + // fixme: check if this remains broken in wekbit nightlies + // var match = browser.regexp(navigator.userAgent); + var match = browser.regexp.exec(navigator.userAgent); if (match && match[1] >= browser.version) { browserSupported = true; } @@ -92,7 +95,8 @@ Ox.load.UI = function(options, callback) { .appendTo(div); }); */ - var deg = 0, element, interval, + var deg = 0, + element, src = Ox.PATH + 'svg/Ox.UI.' + options.theme + '/symbolLoading.svg' Ox.loadFile(src, function() { element = Ox.element('') @@ -107,13 +111,12 @@ Ox.load.UI = function(options, callback) { e.preventDefault() }) .appendTo(div); - setTimeout(function rotate() { + loadingInterval = setInterval(function() { deg = (deg + 30) % 360; element.css({ MozTransform: 'rotate(' + deg + 'deg)', WebkitTransform: 'rotate(' + deg + 'deg)' }); - Ox.element('OxLoadingScreen')[0] && setTimeout(rotate, 83); }, 83); }); } @@ -267,6 +270,7 @@ Ox.load.UI = function(options, callback) { $div.remove(); }); } else { + clearInterval(loadingInterval); $div.remove(); } });