add config.setDefaultValue
This commit is contained in:
parent
2f85538ce1
commit
38ca543035
1 changed files with 13 additions and 0 deletions
|
|
@ -258,4 +258,17 @@ exports.resetOptions = function(obj) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.setDefaultValue = function(path, name, value) {
|
||||||
|
var opts = defaultOptions[path] || (defaultOptions[path] = {});
|
||||||
|
if (typeof name == "string") {
|
||||||
|
if (opts[name])
|
||||||
|
opts[name].value = value;
|
||||||
|
} else {
|
||||||
|
Object.keys(name).forEach(function(key) {
|
||||||
|
if (opts[key])
|
||||||
|
opts[key].value = name[key];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue