This commit is contained in:
dcore94 2023-03-17 12:24:24 +01:00
parent c4d2db694f
commit f54298fabb
1 changed files with 2 additions and 2 deletions

View File

@ -890,12 +890,12 @@ class CCPMethodEditorController extends HTMLElement{
} }
renderScripts(){ renderScripts(){
const index = this.#rootdoc.querySelector("select[name=script-selector]") ? this.#rootdoc.querySelector("select[name=script-selector]").selectedIndex : 0 const val = this.#rootdoc.querySelector("select[name=script-selector]") ? this.#rootdoc.querySelector("select[name=script-selector]").value : 'deploy-script'
return this.#current.additionalParameters.parameters.map( return this.#current.additionalParameters.parameters.map(
(script, i) => { (script, i) => {
let code = script.value.length ? script.value.join("\r\n") : "" let code = script.value.length ? script.value.join("\r\n") : ""
return ` return `
<textarea rows="5" class="script-area form-control ${i == index ? '' : 'd-none'}" name="${script.name}">${code}</textarea> <textarea rows="5" class="script-area form-control ${script.name === val ? '' : 'd-none'}" name="${script.name}">${code}</textarea>
` `
} }
).join("\n") ).join("\n")