fix display of range inputs (again)

master
Alexander Graf 3 years ago
parent 13e6793c9f
commit f1d7bedd1b

@ -52,3 +52,8 @@ fieldset:disabled .form-control:disabled {
.select2-container--default .select2-selection--multiple .select2-selection__choice {
color: black;
}
/* range input spacing */
.input-group-text {
margin-right: 1em;
}

@ -43,7 +43,9 @@ $('document').ready(function() {
var infinity = $(this).data('infinity');
var step = $(this).attr('step');
$(this).on('input', function() {
value_element.text((infinity && this.value == 0) ? '∞' : (this.value/step).toFixed(2));
var num = (infinity && this.value == 0) ? '∞' : (this.value/step).toFixed(2);
if (num.endsWith('.00')) num = num.substr(0, num.length - 3);
value_element.text(num);
}).trigger('input');
}
});

Loading…
Cancel
Save