From 34aba3b5b9572b707971d1fda9216ebcf91909ba Mon Sep 17 00:00:00 2001 From: Caleb Date: Mon, 5 Sep 2022 21:47:38 -0400 Subject: Moving some functions --- webAO/dom/areaClick.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 webAO/dom/areaClick.ts (limited to 'webAO/dom/areaClick.ts') 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 -- cgit From 776fe2f4241a67be354908df546f300f413a7d42 Mon Sep 17 00:00:00 2001 From: Caleb Date: Thu, 8 Sep 2022 22:20:32 -0400 Subject: I'm so sorry --- webAO/dom/areaClick.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO/dom/areaClick.ts') diff --git a/webAO/dom/areaClick.ts b/webAO/dom/areaClick.ts index 6c3ff6b..1b0fe52 100644 --- a/webAO/dom/areaClick.ts +++ b/webAO/dom/areaClick.ts @@ -5,7 +5,7 @@ import { client } from '../client' */ export function area_click(el: HTMLElement) { const area = client.areas[el.id.substr(4)].name; - client.sendMusicChange(area); + client.sender.sendMusicChange(area); const areaHr = document.createElement("div"); areaHr.className = "hrtext"; -- cgit