Skip to content

Commit

Permalink
Resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
HThuren committed Oct 10, 2023
1 parent 58ca23a commit 6d87346
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
22 changes: 18 additions & 4 deletions src/js/tabs/auxiliary.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import inflection from "inflection";
const auxiliary = {};

const flightModes = ["ARM","ANGLE","HORIZON","ANTI GRAVITY","MAG","HEADFREE","HEADADJ","SERVO1","SERVO2","SERVO3",
"FAILSAFE","AIR MODE","3D","FPV ANGLE MIX","FLIP OVER AFTER CRASH","USER1","USER2","USER3","USER4","ACRO TRAINER","LAUNCH CONTROL"];
"FAILSAFE","AIR MODE","3D","FPV ANGLE MIX","FLIP OVER AFTER CRASH","USER1","USER2","USER3","USER4","ACRO TRAINER","LAUNCH CONTROL"];

auxiliary.initialize = function (callback) {
GUI.active_tab_ref = this;
Expand Down Expand Up @@ -491,21 +491,35 @@ auxiliary.initialize = function (callback) {
}
hasUsedMode = true;
}

/*
let hideUnused = hideUnusedModes && hasUsedMode;
let hideNoFlight = hideNoFlightMode && hasUsedMode;
// let hideNoFlight = hideNoFlightMode && hasUsedMode;
for (let i = 0; i < FC.AUX_CONFIG.length; i++) {
let modeElement = $(`#mode-${i}`);
if (modeElement.find(' .range').length == 0 && modeElement.find(' .link').length == 0) {
// unused mode
modeElement.toggle( ! hideUnused);
}
if( isFlightMode(FC.AUX_CONFIG[i])) {
// not flightMode
modeElement.toggle( ! (hideNoFlightMode && hideUnused));
}
}
*/
let hideUnused = hideUnusedModes && hasUsedMode;
let hideNoFlight = hideNoFlightMode && hasUsedMode;
for (let i = 1; i < FC.AUX_CONFIG.length; i++) { // ARM has index 0
let modeElement = $(`#mode-${i}`);
if (modeElement.find(' .range').length == 0 && modeElement.find(' .link').length == 0) {
// unused mode
modeElement.toggle(!hideUnused);
}

if( ! isFlightMode(FC.AUX_CONFIG[i])) {
// not flightMode mode
modeElement.toggle(!hideNoFlight);
}
}

auto_select_channel(FC.RC.channels, FC.RC.active_channels, FC.RSSI_CONFIG.channel);

auxChannelCount = FC.RC.active_channels - 4;
Expand Down
8 changes: 4 additions & 4 deletions src/tabs/auxiliary.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
</div>

<div class="toolbox">
<form>
<input type="checkbox" id="switch-toggle-unused" name="switch-toggle-unused" class="toggle" />
<span i18n="auxiliaryToggleUnused"></span>
</form>
<form>
<input type="checkbox" id="switch-toggle-hideNoFlightMode" name="switch-toggle-hideNoFlightMode" class="toggle" />
<span i18n="auxiliaryToggleNoFlightMode"></span>
</form>
<form>
<input type="checkbox" id="switch-toggle-unused" name="switch-toggle-unused" class="toggle" />
<span i18n="auxiliaryToggleUnused"></span>
</form>
</div>

<div class="modes"></div>
Expand Down

0 comments on commit 6d87346

Please sign in to comment.