change profile input element to select
parent
b826d8a6cf
commit
69e23197e1
|
@ -51,14 +51,11 @@
|
|||
border-bottom: 1px solid #8b8b8b;
|
||||
background-color: #ececec;
|
||||
}
|
||||
.tab-pid_tuning .profile input {
|
||||
display: block;
|
||||
|
||||
.tab-pid_tuning .profile select {
|
||||
width: 100%;
|
||||
padding-left: calc(100% - 35px);
|
||||
height: 20px;
|
||||
|
||||
line-height: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
.tab-pid_tuning .pid_tuning {
|
||||
width: 60%;
|
||||
|
|
|
@ -79,7 +79,11 @@
|
|||
<div class="clear-both"></div>
|
||||
<div class="profile">
|
||||
<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 class="buttons">
|
||||
<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));
|
||||
|
||||
// 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
|
||||
$('input[name="profile"]').change(function () {
|
||||
$('select[name="profile"]').change(function () {
|
||||
var profile = parseInt($(this).val());
|
||||
MSP.send_message(MSP_codes.MSP_SELECT_SETTING, [profile - 1], false, function () {
|
||||
GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile]));
|
||||
MSP.send_message(MSP_codes.MSP_SELECT_SETTING, [profile], false, function () {
|
||||
GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile + 1]));
|
||||
|
||||
GUI.tab_switch_cleanup(function () {
|
||||
TABS.pid_tuning.initialize();
|
||||
|
|
Loading…
Reference in New Issue