diff options
author | Maxim Devaev <[email protected]> | 2023-03-19 01:17:31 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-03-19 02:16:20 +0200 |
commit | 84563553b8a2f00bbb4b1559029f77ad225627f4 (patch) | |
tree | 6795ccb04bff10d2c2bd09c1ce6381f381727007 /web/share/js/kvm/ocr.js | |
parent | 097dbc517df4fcfb8d37d958744b1eb1f0e8d8b6 (diff) |
fixed msd parts api
Diffstat (limited to 'web/share/js/kvm/ocr.js')
-rw-r--r-- | web/share/js/kvm/ocr.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/web/share/js/kvm/ocr.js b/web/share/js/kvm/ocr.js index ee234893..eef26c5a 100644 --- a/web/share/js/kvm/ocr.js +++ b/web/share/js/kvm/ocr.js @@ -73,12 +73,9 @@ export function Ocr(__getGeometry) { self.setState = function(state) { let enabled = (state && state.ocr.enabled && navigator.clipboard && !tools.browser.is_mobile); if (enabled) { - let selected = tools.storage.get("stream.ocr.lang", state.ocr.langs["default"]); - let html = ""; - for (let variant of state.ocr.langs.available) { - html += `<option value=${variant} ${variant === selected ? "selected" : ""}>${variant}</option>`; - } - $("stream-ocr-lang-selector").innerHTML = html; + let el = $("stream-ocr-lang-selector"); + tools.selector.setValues(el, state.ocr.langs.available); + tools.selector.setSelectedValue(el, tools.storage.get("stream.ocr.lang", state.ocr.langs["default"])); } tools.feature.setEnabled($("stream-ocr"), enabled); $("stream-ocr-led").className = (enabled ? "led-gray" : "hidden"); |