diff --git a/htdocs/lib/Demodulator.js b/htdocs/lib/Demodulator.js index 9ba349e2..c2146402 100644 --- a/htdocs/lib/Demodulator.js +++ b/htdocs/lib/Demodulator.js @@ -85,9 +85,13 @@ Envelope.prototype.draw = function(visible_range){ scale_ctx.font = "bold 11px sans-serif"; scale_ctx.textBaseline = "top"; scale_ctx.textAlign = "left"; - scale_ctx.fillText(this.demodulator.high_cut.toString(), to_px + env_att_w, env_h2); + if (typeof(this.demodulator.high_cut) === 'number') { + scale_ctx.fillText(this.demodulator.high_cut.toString(), to_px + env_att_w, env_h2); + } scale_ctx.textAlign = "right"; - scale_ctx.fillText(this.demodulator.low_cut.toString(), from_px - env_att_w, env_h2); + if (typeof(this.demodulator.low_cut) === 'number') { + scale_ctx.fillText(this.demodulator.low_cut.toString(), from_px - env_att_w, env_h2); + } } if (typeof line !== "undefined") // out of screen? { diff --git a/htdocs/lib/DemodulatorPanel.js b/htdocs/lib/DemodulatorPanel.js index b0d546d4..c4d6967f 100644 --- a/htdocs/lib/DemodulatorPanel.js +++ b/htdocs/lib/DemodulatorPanel.js @@ -164,15 +164,16 @@ DemodulatorPanel.prototype.updatePanels = function() { $('#openwebrx-panel-digimodes').attr('data-mode', modulation); var mode = Modes.findByModulation(modulation); toggle_panel("openwebrx-panel-digimodes", modulation && (!mode || mode.secondaryFft)); - toggle_panel("openwebrx-panel-wsjt-message", ["ft8", "wspr", "jt65", "jt9", "ft4", "fst4", "fst4w", "q65", "msk144"].indexOf(modulation) >= 0); - toggle_panel("openwebrx-panel-js8-message", modulation == "js8"); - toggle_panel("openwebrx-panel-packet-message", ["packet", "ais"].indexOf(modulation) >= 0); - toggle_panel("openwebrx-panel-pocsag-message", modulation === "pocsag"); - toggle_panel("openwebrx-panel-page-message", modulation === "page"); - toggle_panel("openwebrx-panel-hfdl-message", ["hfdl", "vdl2", "adsb", "acars"].indexOf(modulation) >= 0); - toggle_panel("openwebrx-panel-sstv-message", modulation === "sstv"); - toggle_panel("openwebrx-panel-fax-message", modulation === "fax"); - toggle_panel("openwebrx-panel-ism-message", modulation === "ism"); + // WSJT-X modes share the same panel + toggle_panel("openwebrx-panel-wsjt-message", ['ft8', 'wspr', 'jt65', 'jt9', 'ft4', 'fst4', 'fst4w', "q65", "msk144"].indexOf(modulation) >= 0); + // Aeronautic modes share the same panel + toggle_panel("openwebrx-panel-hfdl-message", ['hfdl', 'vdl2', 'adsb', 'acars'].indexOf(modulation) >= 0); + // Packet modes share the same panel + toggle_panel("openwebrx-panel-packet-message", ['packet', 'ais'].indexOf(modulation) >= 0); + // these modes come with their own + ['js8', 'page', 'pocsag', 'sstv', 'fax', 'ism'].forEach(function(m) { + toggle_panel('openwebrx-panel-' + m + '-message', modulation === m); + }); modulation = this.getDemodulator().get_modulation(); var showing = 'openwebrx-panel-metadata-' + modulation; diff --git a/htdocs/lib/FrequencyDisplay.js b/htdocs/lib/FrequencyDisplay.js index 64861db4..6aa7093d 100644 --- a/htdocs/lib/FrequencyDisplay.js +++ b/htdocs/lib/FrequencyDisplay.js @@ -122,7 +122,9 @@ TuneableFrequencyDisplay.prototype.setupEvents = function() { }); $inputs.on('blur', function(e){ if (!me.input.is(':visible')) return; - if ($inputs.toArray().indexOf(e.relatedTarget) >= 0) return; + if ($inputs.toArray().indexOf(e.relatedTarget) >= 0) { + return; + } submit(); }); me.input.on('keydown', function(e){