Caret/js/settings.js

28 lines
599 B
JavaScript
Raw Normal View History

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);
}
2014-02-27 06:34:02 +00:00
});
});
}
2014-02-27 06:34:02 +00:00
};
});