mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -438,7 +438,7 @@ export function Streamer() {
|
|||||||
|
|
||||||
$("stream-resolution-selector").onchange = (() => __sendParam("resolution", $("stream-resolution-selector").value));
|
$("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-screenshot-button"), __clickScreenshotButton);
|
||||||
tools.setOnClick($("stream-reset-button"), __clickResetButton);
|
tools.setOnClick($("stream-reset-button"), __clickResetButton);
|
||||||
@@ -612,7 +612,6 @@ export function Streamer() {
|
|||||||
let mode = tools.radioGetValue("stream-mode-radio");
|
let mode = tools.radioGetValue("stream-mode-radio");
|
||||||
tools.storage.set("stream.mode", mode);
|
tools.storage.set("stream.mode", mode);
|
||||||
if (mode !== __streamer.getMode()) {
|
if (mode !== __streamer.getMode()) {
|
||||||
setTimeout(() => tools.radioSetValue("stream-mode-radio", mode), 100);
|
|
||||||
tools.hiddenSetVisible($("stream-image"), (mode !== "janus"));
|
tools.hiddenSetVisible($("stream-image"), (mode !== "janus"));
|
||||||
tools.hiddenSetVisible($("stream-video"), (mode === "janus"));
|
tools.hiddenSetVisible($("stream-video"), (mode === "janus"));
|
||||||
if (mode === "janus") {
|
if (mode === "janus") {
|
||||||
|
|||||||
@@ -153,9 +153,9 @@ export var tools = new function() {
|
|||||||
<label for="${name}-${value}">${title}</label>
|
<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}"]`)) {
|
for (let el of $$$(`input[type="radio"][name="${name}"]`)) {
|
||||||
this.setOnClick(el, callback);
|
this.setOnClick(el, callback, prevent_default);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.radioGetValue = function(name) {
|
this.radioGetValue = function(name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user