diff options
| author | RblSb <msrblsb@gmail.com> | 2020-03-02 13:50:16 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-03-02 13:50:16 +0300 |
| commit | 0d36998b0fb8139456bf1eda3f614542fec890c5 (patch) | |
| tree | 304191df9e4725ec89633af8e824f237c1a5bc35 /src/client/Buttons.hx | |
| parent | 948257a8b8f2d0d76910011cb1cfb90e15baafcc (diff) | |
Video sync toggler
Diffstat (limited to 'src/client/Buttons.hx')
| -rw-r--r-- | src/client/Buttons.hx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx index d50773d..f88aa97 100644 --- a/src/client/Buttons.hx +++ b/src/client/Buttons.hx @@ -78,6 +78,23 @@ class Buttons { window.dispatchEvent(new Event("resize")); } + final toggleSynch = ge("#togglesynch"); + toggleSynch.onclick = e -> { + final icon = toggleSynch.firstElementChild; + if (main.isSyncActive) { + if (!window.confirm(Lang.get("toggleSynchConfirm"))) return; + main.isSyncActive = false; + icon.style.color = "rgba(238, 72, 67, 0.75)"; + icon.classList.add("glyphicon-pause"); + icon.classList.remove("glyphicon-play"); + } else { + main.isSyncActive = true; + icon.style.color = ""; + icon.classList.add("glyphicon-play"); + icon.classList.remove("glyphicon-pause"); + main.send({type: UpdatePlaylist}); + } + } final mediaRefresh = ge("#mediarefresh"); mediaRefresh.onclick = e -> { main.refreshPlayer(); |
