added messages to config editor

main
Codinget 5 years ago
parent d0a12a119e
commit b39443df65
  1. 24
      src/js/configEditor.js

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

Loading…
Cancel
Save