aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Buttons.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2021-08-28 01:09:18 +0300
committerRblSb <msrblsb@gmail.com>2021-08-28 01:09:18 +0300
commite2c76dece4ba9daf1dcce338026339c17c9bd6cd (patch)
treed0e61c8c297c6cc5d440e8f8112956dfbcadef94 /src/client/Buttons.hx
parent8c0b2edaa6c07f8f6ac4970059ff8964c8630a4a (diff)
iOS...
Sent from my iPhone
Diffstat (limited to 'src/client/Buttons.hx')
-rw-r--r--src/client/Buttons.hx28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index aba629e..b11e3fd 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -335,7 +335,10 @@ class Buttons {
static function initChatInput(main:Main):Void {
final guestName:InputElement = cast ge("#guestname");
guestName.onkeydown = e -> {
- if (e.keyCode == KeyCode.Return) main.guestLogin(guestName.value);
+ if (e.keyCode == KeyCode.Return) {
+ main.guestLogin(guestName.value);
+ if (Utils.isTouch()) guestName.blur();
+ }
}
final guestPass:InputElement = cast ge("#guestpass");
@@ -343,12 +346,32 @@ class Buttons {
if (e.keyCode == KeyCode.Return) {
main.userLogin(guestName.value, guestPass.value);
guestPass.value = "";
+ if (Utils.isTouch()) guestPass.blur();
}
}
+ if (Utils.isIOS()) {
+ document.ontouchmove = e -> {
+ e.preventDefault();
+ }
+ ge("#chat").style.height = "-webkit-fill-available";
+ }
final chatline:InputElement = cast ge("#chatline");
chatline.onfocus = e -> {
- if (Utils.isTouch()) main.scrollChatToEnd();
+ if (Utils.isIOS()) {
+ var startY = window.scrollY;
+ Timer.delay(() -> {
+ window.scrollBy(0, -(window.scrollY - startY));
+ ge("#chat").style.height = '${window.innerHeight}px';
+ ge("#video").scrollTop = 0;
+ main.scrollChatToEnd();
+ }, 100);
+ } else if (Utils.isTouch()) main.scrollChatToEnd();
+ }
+ chatline.onblur = e -> {
+ if (Utils.isIOS()) {
+ ge("#chat").style.height = "-webkit-fill-available";
+ }
}
new InputWithHistory(chatline, 50, value -> {
if (main.handleCommands(value)) return true;
@@ -359,6 +382,7 @@ class Buttons {
text: value
}
});
+ if (Utils.isTouch()) chatline.blur();
return true;
});
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage