added messages to config editor

Nathan DECHER 5 years ago
parent db52ff95ae
commit 1ca8e46461
  1. 24
      src/js/configEditor.js

@ -63,22 +63,34 @@ class ConfigEditor extends Popup {
this.addContent(span);
if(data.excludes) {
const setEnabled=() =>
const setEnabled=() => {
input.disabled=
data.excludes
.some(key => config.getB(key))
.some(key => config.getB(key));
input.title=input.disabled?`Disable ${data.excludes.join(',')} to enable`:'';
};
setEnabled();
data.excludes.forEach(key => {
let c=config.watchB(key, setEnabled);
this.watchers.push([key, c]);
});
}
if(data.parent) {
input.disabled=!config.getB(data.parent);
let c=config.watchB(data.parent, (k, v) => input.disabled=!v);
} else if(data.parent) {
const setEnabled=() => {
input.disabled=!config.getB(data.parent);
input.title=input.disabled?`Enable ${data.parent} to enable`:'';
};
setEnabled();
let c=config.watchB(data.parent, setEnabled);
this.watchers.push([data.parent, c]);
}
if(data.needsBackend) {
if(window.serverless) {
input.disabled=true;
input.title="Needs backend";
}
}
}
}

Loading…
Cancel
Save