diff options
-rw-r--r-- | web/share/js/kvm/stream.js | 3 | ||||
-rw-r--r-- | web/share/js/tools.js | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js index 272df998..065a0b39 100644 --- a/web/share/js/kvm/stream.js +++ b/web/share/js/kvm/stream.js @@ -438,7 +438,7 @@ export function Streamer() { $("stream-resolution-selector").onchange = (() => __sendParam("resolution", $("stream-resolution-selector").value)); - tools.radioSetOnClick("stream-mode-radio", __clickModeRadio); + tools.radioSetOnClick("stream-mode-radio", __clickModeRadio, false); tools.setOnClick($("stream-screenshot-button"), __clickScreenshotButton); tools.setOnClick($("stream-reset-button"), __clickResetButton); @@ -612,7 +612,6 @@ export function Streamer() { let mode = tools.radioGetValue("stream-mode-radio"); tools.storage.set("stream.mode", mode); if (mode !== __streamer.getMode()) { - setTimeout(() => tools.radioSetValue("stream-mode-radio", mode), 100); tools.hiddenSetVisible($("stream-image"), (mode !== "janus")); tools.hiddenSetVisible($("stream-video"), (mode === "janus")); if (mode === "janus") { diff --git a/web/share/js/tools.js b/web/share/js/tools.js index f61647b3..54e1c7cf 100644 --- a/web/share/js/tools.js +++ b/web/share/js/tools.js @@ -153,9 +153,9 @@ export var tools = new function() { <label for="${name}-${value}">${title}</label> `; }; - this.radioSetOnClick = function(name, callback) { + this.radioSetOnClick = function(name, callback, prevent_default=true) { for (let el of $$$(`input[type="radio"][name="${name}"]`)) { - this.setOnClick(el, callback); + this.setOnClick(el, callback, prevent_default); } }; this.radioGetValue = function(name) { |