Skip to content

Commit

Permalink
Merge pull request #45 from OpenEarable/1.4.0
Browse files Browse the repository at this point in the history
updated the checkbox logic
  • Loading branch information
TobiasRoeddiger authored Aug 7, 2024
2 parents a6cd35f + f156844 commit 46dfcda
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions assets/js/SensorManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,35 @@ $(document).ready(function () {
$('#microphoneGainInner').val('40');
$('#microphoneGainOuter').val('40');
});

$('#isMicEnabled').on('change', function () {
if (!$(this).is(':checked')) {
$('#innerMicrophoneEnabled').prop('checked', false);
$('#outerMicrophoneEnabled').prop('checked', false);
}
});

$('#innerMicrophoneEnabled').on('change', function () {
if ($(this).is(':checked')) {
$('#isMicEnabled').prop('checked', true);
} else if (!$('#outerMicrophoneEnabled').is(':checked')) {
$('#isMicEnabled').prop('checked', false);
}
});

$('#outerMicrophoneEnabled').on('change', function () {
if ($(this).is(':checked')) {
$('#isMicEnabled').prop('checked', true);
} else if (!$('#innerMicrophoneEnabled').is(':checked')) {
$('#isMicEnabled').prop('checked', false);
}
});

$('#microphoneSamplingRate').on('change', function () {
if ($(this).val() == 0) {
$('#isMicEnabled').prop('checked', false);
$('#innerMicrophoneEnabled').prop('checked', false);
$('#outerMicrophoneEnabled').prop('checked', false);
}
});
});

0 comments on commit 46dfcda

Please sign in to comment.