File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 55
55
< input id ="darkmodeCheckbox " type ="checkbox " onchange ="setDarkMode(this.checked) ">
56
56
Dark mode
57
57
</ label >
58
+ < label class ="menu-label ">
59
+ < input id ="fullscreenCheckbox " type ="checkbox " onchange ="setFullscreen(this.checked) ">
60
+ Full Screen
61
+ </ label >
58
62
< label class ="menu-label ">
59
63
< input id ="padsCheckbox " type ="checkbox " checked onchange ="padsVisible(this.checked) ">
60
64
Show footprint pads
Original file line number Diff line number Diff line change @@ -72,6 +72,14 @@ function setDarkMode(value) {
72
72
redrawIfInitDone ( ) ;
73
73
}
74
74
75
+ function setFullscreen ( value ) {
76
+ if ( value ) {
77
+ document . documentElement . requestFullscreen ( ) ;
78
+ } else {
79
+ document . exitFullscreen ( ) ;
80
+ }
81
+ }
82
+
75
83
function fabricationVisible ( value ) {
76
84
writeStorage ( "fabricationVisible" , value ) ;
77
85
settings . renderFabrication = value ;
@@ -936,6 +944,12 @@ window.onload = function(e) {
936
944
prepCheckboxes ( ) ;
937
945
// Triggers render
938
946
changeBomLayout ( settings . bomlayout ) ;
947
+
948
+ // Users may leave fullscreen without touching the checkbox. Uncheck.
949
+ document . addEventListener ( 'fullscreenchange' , ( ) => {
950
+ if ( ! document . fullscreenElement )
951
+ document . getElementById ( 'fullscreenCheckbox' ) . checked = false ;
952
+ } ) ;
939
953
}
940
954
941
955
window . onresize = resizeAll ;
You can’t perform that action at this time.
0 commit comments