forked from 0x2620/pandora
use Ox.loadFiles
This commit is contained in:
parent
8816e41543
commit
03163692fd
1 changed files with 3 additions and 15 deletions
|
@ -177,21 +177,9 @@ appPanel
|
||||||
var prefix = '/static/';
|
var prefix = '/static/';
|
||||||
if (localStorage && localStorage['pandora.debug']) {
|
if (localStorage && localStorage['pandora.debug']) {
|
||||||
Ox.getJSON(prefix + 'json/pandora.json?' + Ox.random(1000), function(files) {
|
Ox.getJSON(prefix + 'json/pandora.json?' + Ox.random(1000), function(files) {
|
||||||
var promises = [];
|
Ox.loadFiles(Ox.map(files, function(file) {
|
||||||
files.forEach(function(file) {
|
return prefix + file;
|
||||||
var dfd = new $.Deferred();
|
}), callback);
|
||||||
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.');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Ox.loadFile(prefix + 'js/pandora.min.js', callback);
|
Ox.loadFile(prefix + 'js/pandora.min.js', callback);
|
||||||
|
|
Loading…
Reference in a new issue