improvements

This commit is contained in:
dcore94 2023-03-17 12:16:30 +01:00
parent cad9b5684f
commit c4d2db694f
1 changed files with 4 additions and 3 deletions

View File

@ -861,7 +861,7 @@ class CCPMethodEditorController extends HTMLElement{
renderInfrastructures(){
return this.#current.links.filter(l=>l.rel === "compatibleWith").map((l, i)=>{
return `
<div class="ccp-option badge ccp-keyword" title="${l}" alt="${l}">
<div class="ccp-option badge ccp-keyword" title="${l.description}" alt="${l.description}">
<span>${l.title}</span>
<span class="btn text-danger ccp-toolbar-button" name="delete-infrastructure" data-index="${i}">x</span>
</div>
@ -890,11 +890,12 @@ class CCPMethodEditorController extends HTMLElement{
}
renderScripts(){
const index = this.#rootdoc.querySelector("select[name=script-selector]") ? this.#rootdoc.querySelector("select[name=script-selector]").selectedIndex : 0
return this.#current.additionalParameters.parameters.map(
(script, i) => {
let code = script.value.length ? script.value.join("\r\n") : ""
return `
<textarea rows="5" class="script-area form-control d-none" name="${script.name}">${code}</textarea>
return `
<textarea rows="5" class="script-area form-control ${i == index ? '' : 'd-none'}" name="${script.name}">${code}</textarea>
`
}
).join("\n")