add toggle to disable showing the details of the selected aircraft

This commit is contained in:
Matthias Wirth
2020-11-22 12:26:44 +01:00
parent 3dcd72825e
commit 7ea3f0db78

View File

@@ -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))');
@@ -2860,7 +2870,7 @@ function showMap() {
}
function setSelectedInfoBlockVisibility() {
if (SelectedPlane) {
if (SelectedPlane && toggles['selectedDetails'].state) {
$('#selected_infoblock').show();
if (!mapIsVisible)
$("#sidebar_container").css('margin-left', '140pt');
@@ -2868,8 +2878,7 @@ function setSelectedInfoBlockVisibility() {
//
$('#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');