Skip to content

Commit 6d87346

Browse files
committed
Resolved
1 parent 58ca23a commit 6d87346

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

src/js/tabs/auxiliary.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import inflection from "inflection";
1414
const auxiliary = {};
1515

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

1919
auxiliary.initialize = function (callback) {
2020
GUI.active_tab_ref = this;
@@ -491,21 +491,35 @@ auxiliary.initialize = function (callback) {
491491
}
492492
hasUsedMode = true;
493493
}
494-
494+
/*
495495
let hideUnused = hideUnusedModes && hasUsedMode;
496-
let hideNoFlight = hideNoFlightMode && hasUsedMode;
496+
// let hideNoFlight = hideNoFlightMode && hasUsedMode;
497497
for (let i = 0; i < FC.AUX_CONFIG.length; i++) {
498+
let modeElement = $(`#mode-${i}`);
499+
if (modeElement.find(' .range').length == 0 && modeElement.find(' .link').length == 0) {
500+
// unused mode
501+
modeElement.toggle( ! hideUnused);
502+
}
503+
if( isFlightMode(FC.AUX_CONFIG[i])) {
504+
// not flightMode
505+
modeElement.toggle( ! (hideNoFlightMode && hideUnused));
506+
}
507+
}
508+
*/
509+
let hideUnused = hideUnusedModes && hasUsedMode;
510+
let hideNoFlight = hideNoFlightMode && hasUsedMode;
511+
for (let i = 1; i < FC.AUX_CONFIG.length; i++) { // ARM has index 0
498512
let modeElement = $(`#mode-${i}`);
499513
if (modeElement.find(' .range').length == 0 && modeElement.find(' .link').length == 0) {
500514
// unused mode
501515
modeElement.toggle(!hideUnused);
502516
}
517+
503518
if( ! isFlightMode(FC.AUX_CONFIG[i])) {
504519
// not flightMode mode
505520
modeElement.toggle(!hideNoFlight);
506521
}
507522
}
508-
509523
auto_select_channel(FC.RC.channels, FC.RC.active_channels, FC.RSSI_CONFIG.channel);
510524

511525
auxChannelCount = FC.RC.active_channels - 4;

src/tabs/auxiliary.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
</div>
1010

1111
<div class="toolbox">
12-
<form>
13-
<input type="checkbox" id="switch-toggle-unused" name="switch-toggle-unused" class="toggle" />
14-
<span i18n="auxiliaryToggleUnused"></span>
15-
</form>
1612
<form>
1713
<input type="checkbox" id="switch-toggle-hideNoFlightMode" name="switch-toggle-hideNoFlightMode" class="toggle" />
1814
<span i18n="auxiliaryToggleNoFlightMode"></span>
1915
</form>
16+
<form>
17+
<input type="checkbox" id="switch-toggle-unused" name="switch-toggle-unused" class="toggle" />
18+
<span i18n="auxiliaryToggleUnused"></span>
19+
</form>
2020
</div>
2121

2222
<div class="modes"></div>

0 commit comments

Comments
 (0)