mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-21 23:35:22 +03:00
keep active subtab selected on PID Tuning tab, change displayed data only
This commit is contained in:
parent
f547d84eef
commit
f1ce8075ad
1 changed files with 19 additions and 23 deletions
|
@ -9,7 +9,8 @@ TABS.pid_tuning = {
|
||||||
currentRateProfile: null,
|
currentRateProfile: null,
|
||||||
SETPOINT_WEIGHT_RANGE_LOW: 2.55,
|
SETPOINT_WEIGHT_RANGE_LOW: 2.55,
|
||||||
SETPOINT_WEIGHT_RANGE_HIGH: 20,
|
SETPOINT_WEIGHT_RANGE_HIGH: 20,
|
||||||
SETPOINT_WEIGHT_RANGE_LEGACY: 2.54
|
SETPOINT_WEIGHT_RANGE_LEGACY: 2.54,
|
||||||
|
activeSubtab: 'pid',
|
||||||
};
|
};
|
||||||
|
|
||||||
TABS.pid_tuning.initialize = function (callback) {
|
TABS.pid_tuning.initialize = function (callback) {
|
||||||
|
@ -891,33 +892,28 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
self.currentRates.rc_expo_pitch = self.currentRates.rc_expo;
|
self.currentRates.rc_expo_pitch = self.currentRates.rc_expo;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.tab-pid_tuning .tab_container .pid').on('click', function () {
|
function activateSubtab(subtabName) {
|
||||||
$('.tab-pid_tuning .subtab-pid').show();
|
const names = ['pid', 'rates', 'filter'];
|
||||||
$('.tab-pid_tuning .subtab-rates').hide();
|
if (!names.includes(subtabName)) {
|
||||||
$('.tab-pid_tuning .subtab-filter').hide();
|
console.debug('Invalid subtab name: "' + subtabName + '"');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (name of names) {
|
||||||
|
const el = $('.tab-pid_tuning .subtab-' + name);
|
||||||
|
el[name == subtabName ? 'show' : 'hide']();
|
||||||
|
}
|
||||||
$('.tab-pid_tuning .tab_container td').removeClass('active');
|
$('.tab-pid_tuning .tab_container td').removeClass('active');
|
||||||
$(this).addClass('active');
|
$('.tab-pid_tuning .tab_container .' + subtabName).addClass('active');
|
||||||
});
|
self.activeSubtab = subtabName;
|
||||||
|
}
|
||||||
|
|
||||||
$('.tab-pid_tuning .tab_container .rates').on('click', function () {
|
activateSubtab(self.activeSubtab);
|
||||||
$('.tab-pid_tuning .subtab-rates').show();
|
|
||||||
$('.tab-pid_tuning .subtab-pid').hide();
|
|
||||||
$('.tab-pid_tuning .subtab-filter').hide();
|
|
||||||
|
|
||||||
$('.tab-pid_tuning .tab_container td').removeClass('active');
|
$('.tab-pid_tuning .tab_container .pid').on('click', () => activateSubtab('pid'));
|
||||||
$(this).addClass('active');
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.tab-pid_tuning .tab_container .filter').on('click', function () {
|
$('.tab-pid_tuning .tab_container .rates').on('click', () => activateSubtab('rates'));
|
||||||
$('.tab-pid_tuning .subtab-filter').show();
|
|
||||||
$('.tab-pid_tuning .subtab-pid').hide();
|
|
||||||
$('.tab-pid_tuning .subtab-rates').hide();
|
|
||||||
|
|
||||||
$('.tab-pid_tuning .tab_container td').removeClass('active');
|
|
||||||
$(this).addClass('active');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
$('.tab-pid_tuning .tab_container .filter').on('click', () => activateSubtab('filter'));
|
||||||
|
|
||||||
function loadProfilesList() {
|
function loadProfilesList() {
|
||||||
var numberOfProfiles = 3;
|
var numberOfProfiles = 3;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue