Skip to content

Commit

Permalink
add toggle to disable showing the details of the selected aircraft
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Nov 22, 2020
1 parent 3dcd728 commit 7ea3f0d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,16 @@ function initPage() {
}
});

new Toggle({
key: "selectedDetails",
display: "Selected Aircraft Details",
container: "#settingsLeft",
init: true,
setState: function(state) {
setSelectedInfoBlockVisibility();
}
});

if (onMobile) {
$('#large_mode_button').css('width', 'calc( 45px * let(--SCALE))');
$('#large_mode_button').css('height', 'calc( 45px * let(--SCALE))');
Expand Down Expand Up @@ -2860,16 +2870,15 @@ function showMap() {
}

function setSelectedInfoBlockVisibility() {
if (SelectedPlane) {
if (SelectedPlane && toggles['selectedDetails'].state) {
$('#selected_infoblock').show();
if (!mapIsVisible)
$("#sidebar_container").css('margin-left', '140pt');
//$('#sidebar_canvas').css('margin-bottom', $('#selected_infoblock').height() + 'px');
//
$('#large_mode_control').css('left', (190 * globalScale) + 'px');
$('.ol-scale-line').css('left', (180 * globalScale + 8) + 'px');
}
else {
} else {
$('#selected_infoblock').hide();
if (!mapIsVisible)
$("#sidebar_container").css('margin-left', '0');
Expand Down

0 comments on commit 7ea3f0d

Please sign in to comment.