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

Function populateBomHeader

InteractiveHtmlBom/web/ibom.js:481–637  ·  view source on GitHub ↗
(placeHolderColumn = null, placeHolderElements = null)

Source from the content-addressed store, hash-verified

479}
480
481function populateBomHeader(placeHolderColumn = null, placeHolderElements = null) {
482 while (bomhead.firstChild) {
483 bomhead.removeChild(bomhead.firstChild);
484 }
485 var tr = document.createElement("TR");
486 var th = document.createElement("TH");
487 th.classList.add("numCol");
488
489 var vismenu = document.createElement("div");
490 vismenu.id = "vismenu";
491 vismenu.classList.add("menu");
492
493 var visbutton = document.createElement("div");
494 visbutton.classList.add("visbtn");
495 visbutton.classList.add("hideonprint");
496
497 var viscontent = document.createElement("div");
498 viscontent.classList.add("menu-content");
499 viscontent.id = "vismenu-content";
500
501 settings.columnOrder.forEach(column => {
502 if (typeof column !== "string")
503 return;
504
505 // Skip empty columns
506 if (column === "checkboxes" && settings.checkboxes.length == 0)
507 return;
508 else if (column === "Quantity" && settings.bommode == "ungrouped")
509 return;
510
511 var label = document.createElement("label");
512 label.classList.add("menu-label");
513
514 var input = document.createElement("input");
515 input.classList.add("visibility_checkbox");
516 input.type = "checkbox";
517 input.onchange = function (e) {
518 setShowBOMColumn(column, e.target.checked)
519 };
520 input.checked = !(settings.hiddenColumns.includes(column));
521
522 label.appendChild(input);
523 if (column.length > 0)
524 label.append(column[0].toUpperCase() + column.slice(1));
525
526 viscontent.appendChild(label);
527 });
528
529 viscontent.childNodes[0].classList.add("menu-label-top");
530
531 vismenu.appendChild(visbutton);
532 if (settings.bommode != "netlist") {
533 vismenu.appendChild(viscontent);
534 th.appendChild(vismenu);
535 }
536 tr.appendChild(th);
537
538 var checkboxCompareClosure = function (checkbox) {

Callers 2

mouseMoveHandlerFunction · 0.85
populateBomTableFunction · 0.85

Calls 7

setShowBOMColumnFunction · 0.85
createColumnHeaderFunction · 0.85
checkboxCompareClosureFunction · 0.85
compareRefsFunction · 0.85
valueCompareFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected