mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 21:05:30 +03:00
Expert mode toggle refactoring
This commit is contained in:
parent
4583ad4a0d
commit
b63c02673a
3 changed files with 16 additions and 7 deletions
|
@ -115,7 +115,7 @@ TuningSliders.initialize = function() {
|
||||||
this.setDMinFeatureEnabled($('#dMinSwitch').is(':checked'));
|
this.setDMinFeatureEnabled($('#dMinSwitch').is(':checked'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setExpertMode($('input[name="expertModeCheckbox"]').is(':checked'));
|
this.setExpertMode(isExpertModeEnabled());
|
||||||
|
|
||||||
this.initPidSlidersPosition();
|
this.initPidSlidersPosition();
|
||||||
this.initGyroFilterSliderPosition();
|
this.initGyroFilterSliderPosition();
|
||||||
|
@ -130,8 +130,8 @@ TuningSliders.initialize = function() {
|
||||||
this.updateFilterSlidersDisplay();
|
this.updateFilterSlidersDisplay();
|
||||||
};
|
};
|
||||||
|
|
||||||
TuningSliders.setExpertMode = function() {
|
TuningSliders.setExpertMode = function(expertModeEnabled) {
|
||||||
this.expertMode = isExpertModeEnabled();
|
this.expertMode = expertModeEnabled;
|
||||||
|
|
||||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
|
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
|
||||||
document.getElementById('sliderDMaxGain').disabled = !this.expertMode;
|
document.getElementById('sliderDMaxGain').disabled = !this.expertMode;
|
||||||
|
|
|
@ -515,8 +515,8 @@ function startProcess() {
|
||||||
$(expertModeCheckbox).prop('checked', true);
|
$(expertModeCheckbox).prop('checked', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(expertModeCheckbox).change(function () {
|
$(expertModeCheckbox).on("change", () => {
|
||||||
const checked = $(this).is(':checked');
|
const checked = $(expertModeCheckbox).is(':checked');
|
||||||
checkSetupAnalytics(function (analyticsService) {
|
checkSetupAnalytics(function (analyticsService) {
|
||||||
analyticsService.setDimension(analyticsService.DIMENSIONS.CONFIGURATOR_EXPERT_MODE, checked ? 'On' : 'Off');
|
analyticsService.setDimension(analyticsService.DIMENSIONS.CONFIGURATOR_EXPERT_MODE, checked ? 'On' : 'Off');
|
||||||
});
|
});
|
||||||
|
@ -525,8 +525,12 @@ function startProcess() {
|
||||||
updateTabList(FC.FEATURE_CONFIG.features);
|
updateTabList(FC.FEATURE_CONFIG.features);
|
||||||
}
|
}
|
||||||
|
|
||||||
TuningSliders.setExpertMode(checked);
|
if (GUI.active_tab) {
|
||||||
}).change();
|
TABS[GUI.active_tab]?.expertModeChanged?.(checked);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(expertModeCheckbox).trigger("change");
|
||||||
});
|
});
|
||||||
|
|
||||||
ConfigStorage.get('cliAutoComplete', function (result) {
|
ConfigStorage.get('cliAutoComplete', function (result) {
|
||||||
|
|
|
@ -3017,3 +3017,8 @@ TABS.pid_tuning.changeRatesTypeLogo = function() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
TABS.pid_tuning.expertModeChanged = function(expertModeEnabled) {
|
||||||
|
TuningSliders.setExpertMode(expertModeEnabled);
|
||||||
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue