mousewheel control for the sliders <3

This commit is contained in:
Jakob Ketterl 2019-10-24 20:00:30 +02:00
parent d3ac44c526
commit afa322a83b

View File

@ -1948,6 +1948,22 @@ function openwebrx_init() {
init_header(); init_header();
bookmarks = new BookmarkBar(); bookmarks = new BookmarkBar();
parseHash(); parseHash();
initSliders();
}
function initSliders() {
$('#openwebrx-panel-receiver').on('wheel', 'input[type=range]', function(ev){
var $slider = $(this);
if (!$slider.attr('step')) return;
var val = Number($slider.val());
var step = Number($slider.attr('step'));
if (ev.originalEvent.wheelDelta < 0) {
step *= -1;
}
val += step;
$slider.val(val + (ev.originalEvent.wheelDelta > 0 ? 1 : -1))
$slider.trigger('change');
});
} }
function digimodes_init() { function digimodes_init() {