touch improvements

This commit is contained in:
Devaev Maxim
2018-09-08 01:16:37 +03:00
parent 3a68c2ae10
commit 15981e62b5
9 changed files with 65 additions and 64 deletions

View File

@@ -24,10 +24,8 @@ function Mouse() {
$("stream-box").ontouchstart = (event) => __touchMoveHandler(event);
Array.prototype.forEach.call(document.querySelectorAll("[data-mouse-button]"), function(el_button) {
var button = el_button.getAttribute("data-mouse-button");
el_button.onmousedown = () => __sendButton(button, true);
el_button.onmouseup = () => __sendButton(button, false);
el_button.ontouchstart = () => __sendButton(button, true);
el_button.ontouchend = () => __sendButton(button, false);
tools.setOnDown(el_button, () => __sendButton(button, true));
tools.setOnUp(el_button, () => __sendButton(button, false));
});
setInterval(__sendMove, 100);
@@ -74,7 +72,6 @@ function Mouse() {
};
var __touchMoveHandler = function(event) {
event.stopPropagation();
event.preventDefault();
if (event.touches[0].target && event.touches[0].target.getBoundingClientRect) {
var rect = event.touches[0].target.getBoundingClientRect();