mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Made feature switches automatically toggle a document.body classname.
This commit is contained in:
parent
931b1ea537
commit
6c488dba63
@ -49,7 +49,7 @@ body {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
body.forceShowUnitControlPanel #unit-control-panel {
|
||||
body.feature-forceShowUnitControlPanel #unit-control-panel {
|
||||
display:block !important;
|
||||
}
|
||||
|
||||
|
||||
@ -86,10 +86,7 @@ export class FeatureSwitches {
|
||||
"defaultEnabled": false,
|
||||
"label": "Force show unit control panel",
|
||||
"masterSwitch": true,
|
||||
"name": "forceShowUnitControlPanel",
|
||||
"onEnabled": function() {
|
||||
document.body.classList.add( "forceShowUnitControlPanel" );
|
||||
}
|
||||
"name": "forceShowUnitControlPanel"
|
||||
})
|
||||
|
||||
];
|
||||
@ -118,12 +115,9 @@ export class FeatureSwitches {
|
||||
if ( featureSwitch.isEnabled() ) {
|
||||
|
||||
if ( typeof featureSwitch.onEnabled === "function" ) {
|
||||
|
||||
featureSwitch.onEnabled();
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
document.querySelectorAll( "[data-feature-switch='" + featureSwitch.name + "']" ).forEach( el => {
|
||||
@ -137,6 +131,9 @@ export class FeatureSwitches {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
document.body.classList.toggle( "feature-" + featureSwitch.name, featureSwitch.isEnabled() );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user