mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-21 15:25:22 +03:00
HideMotorPoles
Suggested changes Doblewhitespace
This commit is contained in:
parent
fcb78e2b8f
commit
df2db988d5
1 changed files with 8 additions and 1 deletions
|
@ -516,6 +516,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
$('input[name="motorPoles"]').val(MOTOR_CONFIG.motor_poles);
|
$('input[name="motorPoles"]').val(MOTOR_CONFIG.motor_poles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hideMotorPoles() {
|
||||||
|
let motorPolesVisible = $("input[id='dshotBidir']").is(':checked') || $("input[name='ESC_SENSOR']").is(':checked');
|
||||||
|
$('div.motorPoles').toggle(motorPolesVisible);
|
||||||
|
}
|
||||||
|
|
||||||
$('#escProtocolTooltip').toggle(semver.lt(CONFIG.apiVersion, "1.42.0"));
|
$('#escProtocolTooltip').toggle(semver.lt(CONFIG.apiVersion, "1.42.0"));
|
||||||
$('#escProtocolTooltipNoDSHOT1200').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
|
$('#escProtocolTooltipNoDSHOT1200').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
|
||||||
|
|
||||||
|
@ -542,13 +547,15 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
$('div.checkboxDshotBidir').toggle(semver.gte(CONFIG.apiVersion, "1.42.0") && digitalProtocol);
|
$('div.checkboxDshotBidir').toggle(semver.gte(CONFIG.apiVersion, "1.42.0") && digitalProtocol);
|
||||||
$('div.motorPoles').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
|
$('div.motorPoles').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
|
||||||
|
//trigger change dshotBidir and ESC_SENSOR to show/hide Motor Poles tab
|
||||||
|
$("input[id='dshotBidir']").change(hideMotorPoles).change();
|
||||||
|
$("input[name='ESC_SENSOR']").change(hideMotorPoles);
|
||||||
|
|
||||||
//trigger change unsyncedPWMSwitch to show/hide Motor PWM freq input
|
//trigger change unsyncedPWMSwitch to show/hide Motor PWM freq input
|
||||||
$("input[id='unsyncedPWMSwitch']").change();
|
$("input[id='unsyncedPWMSwitch']").change();
|
||||||
|
|
||||||
}).change();
|
}).change();
|
||||||
|
|
||||||
|
|
||||||
// Gyro and PID update
|
// Gyro and PID update
|
||||||
var gyroUse32kHz_e = $('input[id="gyroUse32kHz"]');
|
var gyroUse32kHz_e = $('input[id="gyroUse32kHz"]');
|
||||||
var gyro_select_e = $('select.gyroSyncDenom');
|
var gyro_select_e = $('select.gyroSyncDenom');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue