diff options
| author | Caleb <caleb.mabry.15@cnu.edu> | 2022-09-05 21:47:38 -0400 |
|---|---|---|
| committer | Caleb <caleb.mabry.15@cnu.edu> | 2022-09-05 21:47:38 -0400 |
| commit | 34aba3b5b9572b707971d1fda9216ebcf91909ba (patch) | |
| tree | ff2d11b06ce91cfdc2c33181fc4a6aa22c854eaf /webAO/dom/areaClick.ts | |
| parent | 6f72f845455f517b47da96c7d3d474c6582000fb (diff) | |
Moving some functions
Diffstat (limited to 'webAO/dom/areaClick.ts')
| -rw-r--r-- | webAO/dom/areaClick.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/webAO/dom/areaClick.ts b/webAO/dom/areaClick.ts new file mode 100644 index 0000000..6c3ff6b --- /dev/null +++ b/webAO/dom/areaClick.ts @@ -0,0 +1,15 @@ +import { client } from '../client' +/** + * Triggered when an item on the area list is clicked. + * @param {HTMLElement} el + */ +export function area_click(el: HTMLElement) { + const area = client.areas[el.id.substr(4)].name; + client.sendMusicChange(area); + + const areaHr = document.createElement("div"); + areaHr.className = "hrtext"; + areaHr.textContent = `switched to ${el.textContent}`; + document.getElementById("client_log")!.appendChild(areaHr); +} +window.area_click = area_click;
\ No newline at end of file |
