Caret/js/settings.js
2014-02-26 22:34:02 -08:00

28 lines
No EOL
599 B
JavaScript

define([
"command",
"storage/settingsProvider",
], function(command, Settings) {
/* A plugin that handles loading Settings "synchronously" */
return {
load: function(name, parentRequire, onLoad, config) {
if (name.length == 0) {
return onLoad(Settings);
}
var files = name.split(",");
var completed = 0;
files.forEach(function(file) {
Settings.load(file, function() {
completed++;
if (completed == files.length) {
onLoad(Settings);
}
});
});
}
};
});