aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Buttons.hx3
-rw-r--r--src/client/Main.hx1
-rw-r--r--src/client/Utils.hx4
3 files changed, 6 insertions, 2 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index 63934e2..2d32d99 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -210,8 +210,7 @@ class Buttons {
}
static function onClick(el:Element, func:Any->Void):Void {
- final isTouch = untyped __js__("'ontouchstart' in window");
- if (!isTouch) el.onclick = func;
+ if (!Utils.isTouch()) el.onclick = func;
else el.ontouchend = func;
}
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 6c7677b..e5cd58b 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -122,6 +122,7 @@ class Main {
}
final voteSkip = ge("#voteskip");
voteSkip.onclick = e -> {
+ if (Utils.isTouch() && !Browser.window.confirm(Lang.get("skipItemConfirm"))) return;
if (player.isListEmpty()) return;
final items = player.getItems();
final pos = player.getItemPos();
diff --git a/src/client/Utils.hx b/src/client/Utils.hx
index 69671d2..3ac9953 100644
--- a/src/client/Utils.hx
+++ b/src/client/Utils.hx
@@ -6,6 +6,10 @@ import js.Browser.window;
class Utils {
+ public static function isTouch():Bool {
+ return js.Syntax.code("'ontouchstart' in window");
+ }
+
public static function prepend(parent:Element, child:Element):Void {
if (parent.firstChild == null) parent.appendChild(child);
else parent.insertBefore(child, parent.firstChild);
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage