From 0e8aece991bed8896d89a0834661d91ee86208b4 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 13 Sep 2020 13:57:12 +0200 Subject: [PATCH] display current waterfall values on mouse over --- htdocs/openwebrx.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 06883bc..3805ef1 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -87,31 +87,37 @@ function updateWaterfallColors(which) { waterfall_min_level = parseInt($wfmin.val()); if (waterfall_min_level >= waterfall_max_level) { if (!which) { - $wfmin.val(waterfall_max_level - 1); waterfall_min_level = waterfall_max_level -1; } else { - $wfmax.val(waterfall_min_level + 1); waterfall_max_level = waterfall_min_level + 1; } } + updateWaterfallSliders(); +} + +function updateWaterfallSliders() { + $('#openwebrx-waterfall-color-max') + .val(waterfall_max_level) + .attr('title', 'Waterfall maximum level (' + Math.round(waterfall_max_level) + ' dB)'); + $('#openwebrx-waterfall-color-min') + .val(waterfall_min_level) + .attr('title', 'Waterfall minimum level (' + Math.round(waterfall_min_level) + ' dB)'); } function waterfallColorsDefault() { waterfall_min_level = waterfall_min_level_default; waterfall_max_level = waterfall_max_level_default; - $("#openwebrx-waterfall-color-min").val(waterfall_min_level); - $("#openwebrx-waterfall-color-max").val(waterfall_max_level); + updateWaterfallSliders(); waterfallColorsContinuousReset(); } function waterfallColorsAuto(levels) { var min_level = levels.min - waterfall_auto_level_margin.min; - $("#openwebrx-waterfall-color-min").val(min_level); var max_level = levels.max + waterfall_auto_level_margin.max; max_level = Math.max(min_level + (waterfall_auto_level_margin.min_range || 0), max_level); - $("#openwebrx-waterfall-color-max").val(max_level); waterfall_min_level = min_level; waterfall_max_level = max_level; + updateWaterfallSliders(); } var waterfall_continuous = {