cancelEditRule function

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

Metrics

LOC: 24 Complexity: 3 Params: 0

Signature

cancelEditRule(): : void

Source Code

function cancelEditRule(): void {
  currentEditingRuleId = null;

  // Clear form
  (document.getElementById("rule-url") as HTMLInputElement).value = "";
  (document.getElementById("rule-selector") as HTMLInputElement).value = "";
  (document.getElementById("rule-field-name") as HTMLInputElement).value = "";
  (document.getElementById("rule-fixed") as HTMLInputElement).value = "";
  (document.getElementById("rule-priority") as HTMLInputElement).value = "10";
  ruleTypeSelect?.setValue("");
  ruleGeneratorSelect?.setValue("");
  updateRuleParamsSection();

  // Reset button state
  const btn = document.getElementById("btn-save-rule");
  const cancelBtn = document.getElementById("btn-cancel-rule");
  if (btn) {
    btn.textContent = t("btnSaveRule");
    delete btn.dataset.editing;
  }
  if (cancelBtn) {
    cancelBtn.style.display = "none";
  }
}

Dependencies (Outgoing)

graph LR cancelEditRule["cancelEditRule"] updateRuleParamsSection["updateRuleParamsSection"] cancelEditRule -->|calls| updateRuleParamsSection style cancelEditRule fill:#dbeafe,stroke:#2563eb,stroke-width:2px click cancelEditRule "fd39c6ea074f2721.html" click updateRuleParamsSection "40c364fb8f9a0ec0.html"
TargetType
updateRuleParamsSection calls

Impact (Incoming)

graph LR cancelEditRule["cancelEditRule"] bindRulesEvents["bindRulesEvents"] bindRulesEvents -->|calls| cancelEditRule style cancelEditRule fill:#dbeafe,stroke:#2563eb,stroke-width:2px click cancelEditRule "fd39c6ea074f2721.html" click bindRulesEvents "3107cd11f10b1501.html"
SourceType
bindRulesEvents calls