aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Buttons.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Buttons.hx')
-rw-r--r--src/client/Buttons.hx12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index b8e4a16..b5656e1 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -1,5 +1,6 @@
package client;
+import js.html.ImageElement;
import haxe.Timer;
import js.html.KeyboardEvent;
import js.html.InputElement;
@@ -30,11 +31,16 @@ class Buttons {
final smilesBtn = ge("#smilesbtn");
smilesBtn.onclick = e -> {
- smilesBtn.classList.toggle("active");
final smilesWrap = ge("#smileswrap");
- if (smilesBtn.classList.contains("active"))
- smilesWrap.style.display = "block";
+ if (smilesWrap.children.length == 0) return;
+ final isActive = smilesBtn.classList.toggle("active");
+ if (isActive) smilesWrap.style.display = "block";
else smilesWrap.style.display = "none";
+ if (smilesWrap.firstElementChild.dataset.src == null) return;
+ for (child in smilesWrap.children) {
+ (cast child : ImageElement).src = child.dataset.src;
+ child.removeAttribute("data-src");
+ }
}
ge("#clearchatbtn").onclick = e -> {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage