(condition, element, header)
| 10788 | conditionalHeader(!!legend.children.length, legend, headers.legend); |
| 10789 | } |
| 10790 | function conditionalHeader(condition, element, header) { |
| 10791 | var existing = existingHeader(element, header); |
| 10792 | if (condition && !existing) addHeader(element, header); |
| 10793 | if (!condition && existing) existing.remove(); |
| 10794 | } |
| 10795 | function addHeader(element, header) { |
| 10796 | const h = document.createElement("h4"); |
| 10797 | h.innerHTML = header; |
no test coverage detected