Skip to content

Commit 7cf646f

Browse files
committed
Add toggle to hide top bar
Fixes #422
1 parent ae07550 commit 7cf646f

File tree

3 files changed

+55
-4
lines changed

3 files changed

+55
-4
lines changed

InteractiveHtmlBom/web/ibom.css

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,45 @@ mark.highlight {
617617
flex-wrap: wrap;
618618
justify-content: flex-end;
619619
align-items: center;
620+
}
621+
622+
#topdivider {
620623
border-bottom: 2px solid black;
624+
display: flex;
625+
justify-content: center;
626+
align-items: center;
627+
}
628+
629+
.dark #topdivider {
630+
border-bottom: 2px solid #ccc;
631+
}
632+
633+
#topdivider>div {
634+
position: relative;
635+
}
636+
637+
#toptoggle {
638+
cursor: pointer;
639+
user-select: none;
640+
position: absolute;
641+
padding: 0.1rem 0.3rem;
642+
top: -0.4rem;
643+
left: -1rem;
644+
font-size: 1.4rem;
645+
line-height: 60%;
646+
border: 1px solid black;
647+
border-radius: 1rem;
648+
background-color: #fff;
649+
z-index: 100;
650+
}
651+
652+
.flipped {
653+
transform: rotate(0.5turn);
654+
}
655+
656+
.dark #toptoggle {
657+
border: 1px solid #fff;
658+
background-color: #222;
621659
}
622660

623661
#fileinfodiv {
@@ -634,10 +672,6 @@ mark.highlight {
634672
flex-shrink: 0;
635673
}
636674

637-
.dark #top {
638-
border-bottom: 2px solid #ccc;
639-
}
640-
641675
#dbg {
642676
display: block;
643677
}

InteractiveHtmlBom/web/ibom.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,11 @@
286286
</div>
287287
</div>
288288
</div>
289+
<div id="topdivider">
290+
<div class="hideonprint">
291+
<div id="toptoggle" onclick="topToggle()"></div>
292+
</div>
293+
</div>
289294
<div id="bot" class="split" style="flex: 1 1">
290295
<div id="bomdiv" class="split split-horizontal">
291296
<div style="width: 100%">

InteractiveHtmlBom/web/ibom.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,18 @@ function hideNetlistButton() {
12511251
document.getElementById("bom-netlist-btn").style.display = "none";
12521252
}
12531253

1254+
function topToggle() {
1255+
var top = document.getElementById("top");
1256+
var toptoggle = document.getElementById("toptoggle");
1257+
if (top.style.display === "none") {
1258+
top.style.display = "flex";
1259+
toptoggle.classList.remove("flipped");
1260+
} else {
1261+
top.style.display = "none";
1262+
toptoggle.classList.add("flipped");
1263+
}
1264+
}
1265+
12541266
window.onload = function (e) {
12551267
initUtils();
12561268
initRender();

0 commit comments

Comments
 (0)