mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-20 14:55:15 +03:00
Merge pull request #1875 from McGiverGim/fix_throttle_preview
Fix throttle preview refresh
This commit is contained in:
commit
a27ffbd453
1 changed files with 22 additions and 22 deletions
|
@ -925,28 +925,6 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
self.currentRates.rc_expo_pitch = self.currentRates.rc_expo;
|
||||
}
|
||||
|
||||
function activateSubtab(subtabName) {
|
||||
const names = ['pid', 'rates', 'filter'];
|
||||
if (!names.includes(subtabName)) {
|
||||
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 .tab').removeClass('active');
|
||||
$('.tab-pid_tuning .tab-container .' + subtabName).addClass('active');
|
||||
self.activeSubtab = subtabName;
|
||||
if (subtabName == 'rates') {
|
||||
// force drawing of throttle curve once the throttle curve container element is available
|
||||
// deferring drawing like this is needed to acquire the exact pixel size of the canvas
|
||||
redrawThrottleCurve(true);
|
||||
}
|
||||
}
|
||||
|
||||
activateSubtab(self.activeSubtab);
|
||||
|
||||
$('.tab-pid_tuning .tab-container .pid').on('click', () => activateSubtab('pid'));
|
||||
|
||||
$('.tab-pid_tuning .tab-container .rates').on('click', () => activateSubtab('rates'));
|
||||
|
@ -1154,6 +1132,28 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
|
||||
pid_and_rc_to_form();
|
||||
|
||||
function activateSubtab(subtabName) {
|
||||
const names = ['pid', 'rates', 'filter'];
|
||||
if (!names.includes(subtabName)) {
|
||||
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 .tab').removeClass('active');
|
||||
$('.tab-pid_tuning .tab-container .' + subtabName).addClass('active');
|
||||
self.activeSubtab = subtabName;
|
||||
if (subtabName == 'rates') {
|
||||
// force drawing of throttle curve once the throttle curve container element is available
|
||||
// deferring drawing like this is needed to acquire the exact pixel size of the canvas
|
||||
redrawThrottleCurve(true);
|
||||
}
|
||||
}
|
||||
|
||||
activateSubtab(self.activeSubtab);
|
||||
|
||||
var pidController_e = $('select[name="controller"]');
|
||||
|
||||
if (semver.lt(CONFIG.apiVersion, "1.31.0")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue