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

Function updateCheckboxStats

InteractiveHtmlBom/web/ibom.js:1188–1195  ·  view source on GitHub ↗
(checkbox)

Source from the content-addressed store, hash-verified

1186}
1187
1188function updateCheckboxStats(checkbox) {
1189 var checked = getStoredCheckboxRefs(checkbox).size;
1190 var total = pcbdata.footprints.length - pcbdata.bom.skipped.length;
1191 var percent = checked * 100.0 / total;
1192 var td = document.getElementById("checkbox-stats-" + checkbox);
1193 td.firstChild.style.width = percent + "%";
1194 td.lastChild.innerHTML = checked + "/" + total + " (" + Math.round(percent) + "%)";
1195}
1196
1197function constrain(number, min, max) {
1198 return Math.min(Math.max(parseInt(number), min), max);

Callers 2

clickHandlerFunction · 0.85
prepCheckboxesFunction · 0.85

Calls 1

getStoredCheckboxRefsFunction · 0.85

Tested by

no test coverage detected