diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 0ef67bb..dfdfafc 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -2526,29 +2526,27 @@ function progressbar_set(obj,val,text,over) function demodulator_buttons_update() { $(".openwebrx-demodulator-button").removeClass("highlighted"); - if(secondary_demod) $("#openwebrx-button-dig").addClass("highlighted"); - else switch(demodulators[0].subtype) - { - case "nfm": - $("#openwebrx-button-nfm").addClass("highlighted"); - break; - case "am": - $("#openwebrx-button-am").addClass("highlighted"); - break; - case "lsb": - case "usb": - case "cw": - if(demodulators[0].high_cut-demodulators[0].low_cut<300) - $("#openwebrx-button-cw").addClass("highlighted"); - else - { - if(demodulators[0].high_cut<0) - $("#openwebrx-button-lsb").addClass("highlighted"); - else if(demodulators[0].low_cut>0) - $("#openwebrx-button-usb").addClass("highlighted"); - else $("#openwebrx-button-lsb, #openwebrx-button-usb").addClass("highlighted"); - } - break; + if(secondary_demod) { + $("#openwebrx-button-dig").addClass("highlighted"); + } else switch(demodulators[0].subtype) { + case "lsb": + case "usb": + case "cw": + if(demodulators[0].high_cut-demodulators[0].low_cut<300) + $("#openwebrx-button-cw").addClass("highlighted"); + else + { + if(demodulators[0].high_cut<0) + $("#openwebrx-button-lsb").addClass("highlighted"); + else if(demodulators[0].low_cut>0) + $("#openwebrx-button-usb").addClass("highlighted"); + else $("#openwebrx-button-lsb, #openwebrx-button-usb").addClass("highlighted"); + } + break; + default: + var mod = demodulators[0].subtype; + $("#openwebrx-button-" + mod).addClass("highlighted"); + break; } } function demodulator_analog_replace_last() { demodulator_analog_replace(last_analog_demodulator_subtype); }