MCPcopy Create free account
hub / github.com/openscopeproject/InteractiveHtmlBom / initBooleanSetting

Function initBooleanSetting

InteractiveHtmlBom/web/util.js:558–567  ·  view source on GitHub ↗
(storageString, def, elementId, func)

Source from the content-addressed store, hash-verified

556 populateMarkWhenCheckedOptions();
557
558 function initBooleanSetting(storageString, def, elementId, func) {
559 var b = readStorage(storageString);
560 if (b === null) {
561 b = def;
562 } else {
563 b = (b == "true");
564 }
565 document.getElementById(elementId).checked = b;
566 func(b);
567 }
568
569 initBooleanSetting("padsVisible", config.show_pads, "padsCheckbox", padsVisible);
570 initBooleanSetting("fabricationVisible", config.show_fabrication, "fabricationCheckbox", fabricationVisible);

Callers 1

initDefaultsFunction · 0.85

Calls 1

readStorageFunction · 0.85

Tested by

no test coverage detected