()
| 868 | } |
| 869 | |
| 870 | function buildAttributeSection(): HTMLDivElement { |
| 871 | const name = mkInput("name", "data-custom"); |
| 872 | name.style.width = "110px"; |
| 873 | const val = mkInput("value", "hello"); |
| 874 | val.style.width = "100px"; |
| 875 | const set = mkBtn("Set attr", "primary", () => { |
| 876 | if (!needSelection()) return; |
| 877 | comp!.element(selectedId!).setAttribute(name.value.trim(), val.value.trim() || null); |
| 878 | logEntry("op", { setAttribute: { id: selectedId, name: name.value, value: val.value } }); |
| 879 | }); |
| 880 | const remove = mkBtn("Remove el", "danger", () => { |
| 881 | if (!needSelection()) return; |
| 882 | removeSelected(); |
| 883 | }); |
| 884 | return opSection( |
| 885 | "setAttribute / removeElement", |
| 886 | opRow(mkNote("operates on selected element")), |
| 887 | opRow(name, val, set, remove), |
| 888 | ); |
| 889 | } |
| 890 | |
| 891 | function buildVariableSection(): HTMLDivElement { |
| 892 | const id = mkInput("variable id", "brand-color"); |
nothing calls this directly
no test coverage detected