minor cleanup

This commit is contained in:
rolux 2012-06-20 18:49:06 +02:00
parent 9093d5f3ed
commit 9e35ae0be2
2 changed files with 4 additions and 5 deletions

View file

@ -15,7 +15,6 @@
loadScriptsSerial(data.files, function() { loadScriptsSerial(data.files, function() {
Ox.VERSION = data.version; Ox.VERSION = data.version;
if (args.length == 1) { if (args.length == 1) {
console.log(document.body);
callback() callback()
} else { } else {
Ox.load.apply(null, args); Ox.load.apply(null, args);

View file

@ -116,7 +116,7 @@ Ox.load <f> Loads one or more modules
@*/ @*/
Ox.load = function() { Ox.load = function() {
var callback = arguments[arguments.length - 1], var callback = arguments[arguments.length - 1],
counter = 0, length, modules = {}, success = 0, length, loaded = 0, modules = {}, succeeded = 0,
type = Ox.typeOf(arguments[0]); type = Ox.typeOf(arguments[0]);
if (type == 'string') { if (type == 'string') {
modules = Ox.extend( modules = Ox.extend(
@ -138,9 +138,9 @@ Ox.load = function() {
Ox.getFile( Ox.getFile(
Ox.PATH + 'Ox.' + module + '/Ox.' + module + '.js', Ox.PATH + 'Ox.' + module + '/Ox.' + module + '.js',
function() { function() {
Ox.load[module](options, function(s) { Ox.load[module](options, function(success) {
success += s; succeeded += success;
++counter == length && callback(success == counter); ++loaded == length && callback(succeeded == length);
}); });
} }
); );