MCPcopy
hub / github.com/microsoft/SandDance / conditionalHeader

Function conditionalHeader

docs/app/js/sanddance-app.js:10790–10794  ·  view source on GitHub ↗
(condition, element, header)

Source from the content-addressed store, hash-verified

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

Callers 1

ensureHeadersFunction · 0.70

Calls 3

existingHeaderFunction · 0.70
addHeaderFunction · 0.70
removeMethod · 0.45

Tested by

no test coverage detected