mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-20 06:45:12 +03:00
Merge pull request #1003 from jmguarino/issue#975
Switched dshot beacon input to address issue #975
This commit is contained in:
commit
aa0189bd33
2 changed files with 15 additions and 9 deletions
|
@ -239,7 +239,16 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
var dshotBeeper_e = $('.tab-configuration .dshotbeeper');
|
var dshotBeeper_e = $('.tab-configuration .dshotbeeper');
|
||||||
var dshotBeacon_e = $('.tab-configuration .dshotbeacon');
|
var dshotBeacon_e = $('.tab-configuration .dshotbeacon');
|
||||||
var dshotBeeperSwitch = $('#dshotBeeperSwitch');
|
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() {
|
dshotBeeperSwitch.change(function() {
|
||||||
if ($(this).is(':checked')) {
|
if ($(this).is(':checked')) {
|
||||||
|
@ -260,12 +269,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
dshotBeeperBeaconTone.val(BEEPER_CONFIG.dshotBeaconTone);
|
dshotBeeperBeaconTone.val(BEEPER_CONFIG.dshotBeaconTone);
|
||||||
dshotBeeperSwitch.prop('checked', BEEPER_CONFIG.dshotBeaconTone !== 0).change();
|
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
|
// Analog Beeper
|
||||||
var template = $('.beepers .beeper-template');
|
var template = $('.beepers .beeper-template');
|
||||||
var destination = $('.beepers .beeper-configuration');
|
var destination = $('.beepers .beeper-configuration');
|
||||||
|
|
|
@ -703,9 +703,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="dshotbeacon">
|
<tr class="dshotbeacon">
|
||||||
<td>
|
<td>
|
||||||
<div class="number">
|
<div class="select">
|
||||||
<div style="float: left; height: 20px; margin-right: 10px;">
|
<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>
|
</div>
|
||||||
<label for="dshotBeeperBeaconTone">
|
<label for="dshotBeeperBeaconTone">
|
||||||
<span i18n="configurationDshotBeaconTone"></span>
|
<span i18n="configurationDshotBeaconTone"></span>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue