Do not require MCI configurations in theme.hjson for theme.hjson to apply #167
This commit is contained in:
parent
c758454134
commit
851da9e8c8
|
@ -139,14 +139,18 @@ function getMergedTheme(menuConfig, promptConfig, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
function getFormKeys(fromObj) {
|
function getFormKeys(fromObj) {
|
||||||
return _.remove(_.keys(fromObj), function pred(k) {
|
// remove all non-numbers
|
||||||
return !isNaN(k); // remove all non-numbers
|
return _.remove(_.keys(fromObj), k => !isNaN(k));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergeMciProperties(dest, src) {
|
function mergeMciProperties(dest, src) {
|
||||||
Object.keys(src).forEach(function mciEntry(mci) {
|
Object.keys(src).forEach(mci => {
|
||||||
_.mergeWith(dest[mci], src[mci], mciCustomizer);
|
if(dest[mci]) {
|
||||||
|
_.mergeWith(dest[mci], src[mci], mciCustomizer);
|
||||||
|
} else {
|
||||||
|
// theme contains MCI not in menu; bring in as-is
|
||||||
|
dest[mci] = src[mci];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,11 +190,9 @@ function getMergedTheme(menuConfig, promptConfig, theme) {
|
||||||
if(_.isObject(form.mci)) {
|
if(_.isObject(form.mci)) {
|
||||||
// non-explicit: no MCI code(s) key assumed since we found 'mci' directly under form ID
|
// non-explicit: no MCI code(s) key assumed since we found 'mci' directly under form ID
|
||||||
applyThemeMciBlock(form.mci, menuTheme, formKey);
|
applyThemeMciBlock(form.mci, menuTheme, formKey);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const menuMciCodeKeys = _.remove(_.keys(form), function pred(k) {
|
// remove anything not uppercase
|
||||||
return k === k.toUpperCase(); // remove anything not uppercase
|
const menuMciCodeKeys = _.remove(_.keys(form), k => k === k.toUpperCase());
|
||||||
});
|
|
||||||
|
|
||||||
menuMciCodeKeys.forEach(function mciKeyEntry(mciKey) {
|
menuMciCodeKeys.forEach(function mciKeyEntry(mciKey) {
|
||||||
let applyFrom;
|
let applyFrom;
|
||||||
|
|
Loading…
Reference in New Issue