mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 09:45:37 +03:00
change profile input element to select
This commit is contained in:
parent
b826d8a6cf
commit
69e23197e1
3 changed files with 11 additions and 10 deletions
|
@ -51,14 +51,11 @@
|
||||||
border-bottom: 1px solid #8b8b8b;
|
border-bottom: 1px solid #8b8b8b;
|
||||||
background-color: #ececec;
|
background-color: #ececec;
|
||||||
}
|
}
|
||||||
.tab-pid_tuning .profile input {
|
.tab-pid_tuning .profile select {
|
||||||
display: block;
|
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding-left: calc(100% - 35px);
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
text-align: right;
|
|
||||||
}
|
}
|
||||||
.tab-pid_tuning .pid_tuning {
|
.tab-pid_tuning .pid_tuning {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
|
|
|
@ -79,7 +79,11 @@
|
||||||
<div class="clear-both"></div>
|
<div class="clear-both"></div>
|
||||||
<div class="profile">
|
<div class="profile">
|
||||||
<span class="head" i18n="pidTuningProfileHead"></span>
|
<span class="head" i18n="pidTuningProfileHead"></span>
|
||||||
<input type="number" name="profile" min="1" max="3" />
|
<select name="profile">
|
||||||
|
<option value="0">1</option>
|
||||||
|
<option value="1">2</option>
|
||||||
|
<option value="2">3</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<a class="update" href="#" i18n="pidTuningButtonSave"></a>
|
<a class="update" href="#" i18n="pidTuningButtonSave"></a>
|
||||||
|
|
|
@ -179,13 +179,13 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
$('.rate-tpa input[name="tpa"]').val(RC_tuning.dynamic_THR_PID.toFixed(2));
|
$('.rate-tpa input[name="tpa"]').val(RC_tuning.dynamic_THR_PID.toFixed(2));
|
||||||
|
|
||||||
// Fill in currently selected profile
|
// Fill in currently selected profile
|
||||||
$('input[name="profile"]').val(CONFIG.profile + 1); // +1 because the range is 0-2
|
$('select[name="profile"]').val(CONFIG.profile);
|
||||||
|
|
||||||
// UI Hooks
|
// UI Hooks
|
||||||
$('input[name="profile"]').change(function () {
|
$('select[name="profile"]').change(function () {
|
||||||
var profile = parseInt($(this).val());
|
var profile = parseInt($(this).val());
|
||||||
MSP.send_message(MSP_codes.MSP_SELECT_SETTING, [profile - 1], false, function () {
|
MSP.send_message(MSP_codes.MSP_SELECT_SETTING, [profile], false, function () {
|
||||||
GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile]));
|
GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile + 1]));
|
||||||
|
|
||||||
GUI.tab_switch_cleanup(function () {
|
GUI.tab_switch_cleanup(function () {
|
||||||
TABS.pid_tuning.initialize();
|
TABS.pid_tuning.initialize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue