|
|
|
@ -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) { |
|
|
|
|
} else if(data.parent) { |
|
|
|
|
const setEnabled=() => { |
|
|
|
|
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]); |
|
|
|
|
} |
|
|
|
|
if(data.needsBackend) { |
|
|
|
|
if(window.serverless) { |
|
|
|
|
input.disabled=true; |
|
|
|
|
input.title="Needs backend"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|