Remove touch event handlers

This commit is contained in:
Paulo Gustavo Veiga 2022-11-20 00:37:41 -08:00
parent 4095dd4aee
commit 9dbb054745

View File

@ -273,14 +273,16 @@ class Workspace {
window.document.body.style.cursor = 'move'; window.document.body.style.cursor = 'move';
// If I dont ignore touchmove events, browser console shows a lot of errors: // If I dont ignore touchmove events, browser console shows a lot of errors:
// Unable to preventDefault inside passive event listener invocation. // Unable to preventDefault inside passive event listener invocation.
if (mouseMoveEvent.type !== 'touchmove') mouseMoveEvent.preventDefault(); if (mouseMoveEvent.type !== 'touchmove') {
mouseMoveEvent.preventDefault();
}
// Fire drag event ... // Fire drag event ...
screenManager.fireEvent('update'); screenManager.fireEvent('update');
wasDragged = true; wasDragged = true;
}; };
screenManager.addEvent('mousemove', workspace._mouseMoveListener); screenManager.addEvent('mousemove', workspace._mouseMoveListener);
screenManager.addEvent('touchmove', workspace._mouseMoveListener); // screenManager.addEvent('touchmove', workspace._mouseMoveListener);
// Register mouse up listeners ... // Register mouse up listeners ...
workspace._mouseUpListener = () => { workspace._mouseUpListener = () => {
@ -302,14 +304,14 @@ class Workspace {
} }
}; };
screenManager.addEvent('mouseup', workspace._mouseUpListener); screenManager.addEvent('mouseup', workspace._mouseUpListener);
screenManager.addEvent('touchend', workspace._mouseUpListener); // screenManager.addEvent('touchend', workspace._mouseUpListener);
} }
} else { } else {
workspace._mouseUpListener(); workspace._mouseUpListener();
} }
}; };
screenManager.addEvent('mousedown', mouseDownListener); screenManager.addEvent('mousedown', mouseDownListener);
screenManager.addEvent('touchstart', mouseDownListener); // screenManager.addEvent('touchstart', mouseDownListener);
} }
getZoom() { getZoom() {