updateParamsSection function

Last updated: 2026-03-04T23:21:38.396Z

Metrics

LOC: 36 Complexity: 9 Params: 0

Signature

updateParamsSection(): : void

Source Code

function updateParamsSection(): void {
  if (!rulePopupElement) return;
  const container =
    rulePopupElement.querySelector<HTMLElement>("#fa-rp-params");
  if (!container) return;

  const selectedType = genSearchableSelect?.getValue() ?? "auto";

  if (
    selectedType === "auto" ||
    selectedType === "ai" ||
    selectedType === "tensorflow"
  ) {
    container.style.display = "none";
    container.innerHTML = "";
    return;
  }

  const generatorKey = getGeneratorKey(selectedType as FieldType);
  const paramDefs = generatorKey ? getGeneratorParamDefs(generatorKey) : [];

  if (paramDefs.length === 0) {
    container.style.display = "none";
    container.innerHTML = "";
    return;
  }

  container.innerHTML = renderParamFields(paramDefs);
  container.style.display = "block";

  // Listen for param changes to update preview
  container.querySelectorAll("input, select").forEach((el) => {
    el.addEventListener("input", () => updatePreview());
    el.addEventListener("change", () => updatePreview());
  });
}

Dependencies (Outgoing)

graph LR updateParamsSection["updateParamsSection"] renderParamFields["renderParamFields"] updatePreview["updatePreview"] updateParamsSection -->|calls| renderParamFields updateParamsSection -->|calls| updatePreview style updateParamsSection fill:#dbeafe,stroke:#2563eb,stroke-width:2px click updateParamsSection "9e0d46bd06f35333.html" click renderParamFields "84f004ba7eb960b3.html" click updatePreview "dcabab4647818f61.html"
TargetType
renderParamFields calls
updatePreview calls
input dynamic_call
change dynamic_call

Impact (Incoming)

graph LR updateParamsSection["updateParamsSection"] showRulePopup["showRulePopup"] showRulePopup -->|calls| updateParamsSection style updateParamsSection fill:#dbeafe,stroke:#2563eb,stroke-width:2px click updateParamsSection "9e0d46bd06f35333.html" click showRulePopup "9a11db3b71d6ccf5.html"
SourceType
showRulePopup calls