make a more generic ExponentialInput and use that for the sample_rate input

This commit is contained in:
Jakob Ketterl
2021-02-27 23:14:41 +01:00
parent 7a0c934af5
commit 0537e23e38
5 changed files with 22 additions and 19 deletions

View File

@ -1,4 +1,4 @@
$.fn.frequencyInput = function() {
$.fn.exponentialInput = function() {
var suffixes = {
"K": 3,
"M": 6,
@ -9,7 +9,7 @@ $.fn.frequencyInput = function() {
this.each(function(){
var $group = $(this);
var currentExponent = 0;
$input = $group.find('input');
var $input = $group.find('input');
var setExponent = function() {
var newExponent = parseInt($exponent.val());
@ -26,7 +26,7 @@ $.fn.frequencyInput = function() {
}
});
$exponent = $group.find('select.frequency-exponent');
var $exponent = $group.find('select.exponent');
$exponent.on('change', setExponent);
// calculate initial exponent

View File

@ -7,5 +7,5 @@ $(function(){
$('#rf_gain').gainInput();
$('.optional-section').optionalSection();
$('#scheduler').schedulerInput();
$('.frequency-input').frequencyInput();
$('.exponential-input').exponentialInput();
});