Skip to content

Commit c30edd4

Browse files
committed
rebase
1 parent 5491288 commit c30edd4

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/js/tabs/auxiliary.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,16 +494,38 @@ auxiliary.initialize = function (callback) {
494494

495495
let hideUnused = hideUnusedModes && hasUsedMode;
496496
let hideNoFlight = hideNoFlightMode && hasUsedMode;
497+
console.log(`0 hideUnusedModes: ${hideUnusedModes}, hideNoFlightMode: ${hideNoFlightMode}`);
498+
console.log(`0 hasUsedMode: ${hasUsedMode}, hideUnused: ${hideUnused}, hideNoFlight: ${hideNoFlight}`);
499+
497500
for (let i = 1; i < FC.AUX_CONFIG.length; i++) { // ARM has index 0
498501
let modeElement = $(`#mode-${i}`);
502+
let style = modeElement.css('display');
503+
499504
if (modeElement.find(' .range').length == 0 && modeElement.find(' .link').length == 0) {
500505
// unused mode
506+
style = modeElement.css('display');
507+
console.log(`1 HIDE: ${FC.AUX_CONFIG[i]} ${style}`);
508+
501509
modeElement.toggle(!hideUnused);
510+
511+
style = modeElement.css('display');
512+
console.log(`2 HIDE: ${FC.AUX_CONFIG[i]} ${style}`);
502513
}
503514

504515
if ( ! isFlightMode(FC.AUX_CONFIG[i])) {
505516
// not flightMode mode
506-
modeElement.toggle(!hideNoFlight);
517+
style = modeElement.css('display');
518+
console.log(`1 NOT flightmode: ${FC.AUX_CONFIG[i]} - ${hideNoFlight} - ${style}`);
519+
// modeElement.toggle(!hideNoFlight);
520+
if( hideNoFlight && ! style === 'none') {
521+
modeElement.toggle(!hideUnused);
522+
}
523+
style = modeElement.css('display');
524+
console.log(`2 NOT flightmode: ${FC.AUX_CONFIG[i]} - ${hideNoFlight} - ${style}`);
525+
}
526+
else {
527+
style = modeElement.css('display');
528+
console.log(`Flightmode: ${FC.AUX_CONFIG[i]} - ${style}`);
507529
}
508530
}
509531

0 commit comments

Comments
 (0)