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

Function changeBomMode

InteractiveHtmlBom/web/ibom.js:1023–1058  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

1021}
1022
1023function changeBomMode(mode) {
1024 document.getElementById("bom-grouped-btn").classList.remove("depressed");
1025 document.getElementById("bom-ungrouped-btn").classList.remove("depressed");
1026 document.getElementById("bom-netlist-btn").classList.remove("depressed");
1027 var chkbxs = document.getElementsByClassName("visibility_checkbox");
1028
1029 switch (mode) {
1030 case 'grouped':
1031 document.getElementById("bom-grouped-btn").classList.add("depressed");
1032 for (var i = 0; i < chkbxs.length; i++) {
1033 chkbxs[i].disabled = false;
1034 }
1035 break;
1036 case 'ungrouped':
1037 document.getElementById("bom-ungrouped-btn").classList.add("depressed");
1038 for (var i = 0; i < chkbxs.length; i++) {
1039 chkbxs[i].disabled = false;
1040 }
1041 break;
1042 case 'netlist':
1043 document.getElementById("bom-netlist-btn").classList.add("depressed");
1044 for (var i = 0; i < chkbxs.length; i++) {
1045 chkbxs[i].disabled = true;
1046 }
1047 }
1048
1049 writeStorage("bommode", mode);
1050 if (mode != settings.bommode) {
1051 settings.bommode = mode;
1052 bomSortFunction = null;
1053 currentSortColumn = null;
1054 currentSortOrder = null;
1055 clearHighlightedFootprints();
1056 }
1057 populateBomTable();
1058}
1059
1060function focusFilterField() {
1061 focusInputField(document.getElementById("filter"));

Callers 1

changeCanvasLayoutFunction · 0.85

Calls 4

writeStorageFunction · 0.85
populateBomTableFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected