diff options
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(); |
