1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-21 15:25:22 +03:00

Switched dshot beacon input to select to address issue #975

This commit is contained in:
Justin Guarino 2018-04-07 03:54:01 -07:00
parent dbfe692278
commit 449da9c15f
2 changed files with 15 additions and 9 deletions

View file

@ -239,7 +239,16 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
var dshotBeeper_e = $('.tab-configuration .dshotbeeper');
var dshotBeacon_e = $('.tab-configuration .dshotbeacon');
var dshotBeeperSwitch = $('#dshotBeeperSwitch');
var dshotBeeperBeaconTone = $('#dshotBeeperBeaconTone');
var dshotBeeperBeaconTone = $('select.dshotBeeperBeaconTone');
if (semver.gte(CONFIG.apiVersion, "1.37.0")) {
for (var i = 1; i <= 5; i++) {
dshotBeeperBeaconTone.append('<option value="' + (i) + '">'+ (i) + '</option>');
}
dshotBeeper_e.show();
} else {
dshotBeeper_e.hide();
}
dshotBeeperSwitch.change(function() {
if ($(this).is(':checked')) {
@ -260,12 +269,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
dshotBeeperBeaconTone.val(BEEPER_CONFIG.dshotBeaconTone);
dshotBeeperSwitch.prop('checked', BEEPER_CONFIG.dshotBeaconTone !== 0).change();
if (semver.gte(CONFIG.apiVersion, "1.37.0")) {
dshotBeeper_e.show();
} else {
dshotBeeper_e.hide();
}
// Analog Beeper
var template = $('.beepers .beeper-template');
var destination = $('.beepers .beeper-configuration');

View file

@ -703,9 +703,12 @@
</tr>
<tr class="dshotbeacon">
<td>
<div class="number">
<div class="select">
<div style="float: left; height: 20px; margin-right: 10px;">
<input type="number" id="dshotBeeperBeaconTone" step="1" min="1" max="5" />
<select class="dshotBeeperBeaconTone">
<option value="0" hidden></option>
<!-- list generated here -->
</select>
</div>
<label for="dshotBeeperBeaconTone">
<span i18n="configurationDshotBeaconTone"></span>