MCPcopy Create free account
hub / github.com/JKPotato-Computer/SignMaker / redraw

Function redraw

js/main copy.js:940–1636  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

938 */
939
940 const redraw = function() {
941 const postContainerElmt = document.getElementById("postContainer");
942
943 postContainerElmt.className = `polePosition${post.polePosition}`;
944
945 if (post.showPost == true) {
946 var item = document.getElementsByClassName("post");
947 for (let i = 0; i < item.length; i++) {
948 item[i].style.visibility = "hidden";
949 }
950
951 const panelContainer = document.getElementById("panelContainer");
952
953 panelContainer.style.visibility = "hidden";
954
955
956 } else {
957 var item = document.getElementsByClassName("post");
958 for (let i = 0; i < item.length; i++) {
959
960 if (post.polePosition.toLowerCase() != "overhead") {
961 item[0].style.visibility = "visible";
962 } else {
963 item[i].style.visibility = "visible";
964 }
965 }
966
967 const panelContainer = document.getElementById("panelContainer");
968
969 panelContainer.style.visibility = "visible";
970 }
971
972 const panelContainerElmt = document.getElementById("panelContainer");
973
974
975 lib.clearChildren(panelContainerElmt);
976 for (const panel of post.panels) {
977 const panelElmt = document.createElement("div");
978 panelElmt.className = `panel ${panel.color.toLowerCase()} ${panel.corner.toLowerCase()}`;
979
980 const exitTabCont = document.createElement("div");
981 exitTabCont.className = `exitTabContainer ${panel.exitTab.position.toLowerCase()} ${panel.exitTab.width.toLowerCase()}`;
982 panelElmt.appendChild(exitTabCont);
983
984 const exitTabElmt = document.createElement("div");
985 exitTabElmt.className = `exitTab ${panel.exitTab.position.toLowerCase()} ${panel.exitTab.width.toLowerCase()}`;
986
987 if ((panel.sign.exitTabColor != "Panel Color") && (panel.sign.exitTabColor != undefined)) {
988 exitTabElmt.className += ` ${panel.sign.exitTabColor.toLowerCase()}`
989 } else {
990 exitTabElmt.className += ` ${panel.color.toLowerCase()}`
991 }
992
993 if (panel.exitTab.oldFont) {
994 exitTabElmt.style.fontFamily = "Series E";
995 }
996
997 exitTabCont.appendChild(exitTabElmt);

Callers 11

newPanelFunction · 0.70
duplicatePanelFunction · 0.70
deletePanelFunction · 0.70
shiftLeftFunction · 0.70
shiftRightFunction · 0.70
newShieldFunction · 0.70
deleteShieldFunction · 0.70
clearShieldsFunction · 0.70
duplicateShieldFunction · 0.70
importDataFunction · 0.70
readFormFunction · 0.70

Calls 2

exitOnlyArrowElmtFunction · 0.85
LineEditorFunction · 0.70

Tested by

no test coverage detected