diff options
| author | RblSb <msrblsb@gmail.com> | 2020-05-01 10:10:33 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-05-01 10:10:33 +0300 |
| commit | 7408555ad16b5d0e380d1d90eb62e64eb14987f1 (patch) | |
| tree | d9a5e87c543a4f52549f8fcb0e6da48115dfbc40 /src/client/Buttons.hx | |
| parent | bea88e624b4c271d583c73607be0f37e1498f671 (diff) | |
Minor changes
Diffstat (limited to 'src/client/Buttons.hx')
| -rw-r--r-- | src/client/Buttons.hx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx index d4533bf..a04b444 100644 --- a/src/client/Buttons.hx +++ b/src/client/Buttons.hx @@ -249,16 +249,6 @@ 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 secs = main.synchThreshold; - synchThresholdBtn.innerText += ': ${secs}s'; final swapLayoutBtn = ge("#swapLayoutBtn"); swapLayoutBtn.onclick = e -> { @@ -295,6 +285,18 @@ class Buttons { } } + public static function initTextButtons(main:Main):Void { + final synchThresholdBtn = ge("#synchThresholdBtn"); + synchThresholdBtn.onclick = e -> { + var secs = main.synchThreshold + 1; + if (secs > 5) secs = 1; + main.setSynchThreshold(secs); + updateSynchThresholdBtn(main); + synchThresholdBtn.blur(); + } + updateSynchThresholdBtn(main); + } + static function hideMenus():Void { final menus:Array<Element> = cast document.querySelectorAll(".dropdown-menu"); for (menu in menus) menu.style.display = ""; |
