From 1fb3e2de251f5f1d33a43cd13bc4ca6d3ae23c26 Mon Sep 17 00:00:00 2001 From: RblSb Date: Tue, 10 Mar 2020 08:55:09 +0300 Subject: Show/hide password button --- src/client/Buttons.hx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx index e5c36a0..b8e4a16 100644 --- a/src/client/Buttons.hx +++ b/src/client/Buttons.hx @@ -19,6 +19,15 @@ class Buttons { initChatInput(main); initNavBar(main); + final passIcon = ge("#guestpass_icon"); + passIcon.onclick = e -> { + final isOpen = passIcon.classList.toggle("glyphicon-eye-open"); + passIcon.classList.toggle("glyphicon-eye-close"); + final pass:InputElement = cast ge("#guestpass"); + if (isOpen) pass.type = "password"; + else pass.type = "text"; + } + final smilesBtn = ge("#smilesbtn"); smilesBtn.onclick = e -> { smilesBtn.classList.toggle("active"); -- cgit v1.2.3