use Ox.loadFiles

This commit is contained in:
j 2012-04-19 14:29:47 +02:00
parent 8816e41543
commit 03163692fd

View file

@ -177,21 +177,9 @@ appPanel
var prefix = '/static/';
if (localStorage && localStorage['pandora.debug']) {
Ox.getJSON(prefix + 'json/pandora.json?' + Ox.random(1000), function(files) {
var promises = [];
files.forEach(function(file) {
var dfd = new $.Deferred();
promises.push(dfd.promise());
Ox.loadFile(prefix + file, function() {
dfd.resolve();
});
});
$.when.apply(null, promises)
.done(function() {
callback();
})
.fail(function() {
throw new Error('File not found.');
});
Ox.loadFiles(Ox.map(files, function(file) {
return prefix + file;
}), callback);
});
} else {
Ox.loadFile(prefix + 'js/pandora.min.js', callback);