diff options
| author | RblSb <msrblsb@gmail.com> | 2020-03-02 14:29:03 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-03-02 14:29:03 +0300 |
| commit | b239467d9917849a746f2026c7f0b185a6341914 (patch) | |
| tree | a17a39506d8e8720fced122bca924d8fd6dc9956 /src/client/Buttons.hx | |
| parent | 0d36998b0fb8139456bf1eda3f614542fec890c5 (diff) | |
Synch threshold setting
Diffstat (limited to 'src/client/Buttons.hx')
| -rw-r--r-- | src/client/Buttons.hx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx index f88aa97..d566d68 100644 --- a/src/client/Buttons.hx +++ b/src/client/Buttons.hx @@ -198,6 +198,18 @@ class Buttons { exitBtn.blur(); hideMenus(); } + final synchThresholdBtn = ge("#synchThresholdBtn"); + synchThresholdBtn.onclick = e -> { + var secs = main.synchThreshold + 1; + if (secs > 5) secs = 1; + main.setSynchThreshold(secs); + updateSynchThresholdBtn(main); + synchThresholdBtn.blur(); + } + final text = synchThresholdBtn.innerText; + final secs = main.synchThreshold; + synchThresholdBtn.innerText += ': ${secs}s'; + final swapLayoutBtn = ge("#swapLayoutBtn"); swapLayoutBtn.onclick = e -> { final p = ge("#main"); @@ -227,6 +239,12 @@ class Buttons { for (menu in menus) menu.style.display = ""; } + static function updateSynchThresholdBtn(main:Main):Void { + final text = Lang.get("synchThreshold"); + final secs = main.synchThreshold; + ge("#synchThresholdBtn").innerText = '$text: ${secs}s'; + } + static function initChatInput(main:Main):Void { final guestName:InputElement = cast ge("#guestname"); guestName.onkeydown = e -> { |
