aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-09 13:24:40 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-09 13:24:40 -0700
commit92fe68caa71f9a78b2767f5b618206eb1495aac8 (patch)
tree44ed9498cf0ed011336b407cc89b2b337f32d05f
parentcf0d875a089916b63d051b2e36d7cc00510e0c84 (diff)
preventDefault() when proxying events
-rw-r--r--src/proxyClient.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/proxyClient.js b/src/proxyClient.js
index 41f6a501..5bfa4ddf 100644
--- a/src/proxyClient.js
+++ b/src/proxyClient.js
@@ -54,6 +54,7 @@ function cloneEvent(event) {
['keydown', 'keyup', 'keypress', 'blur', 'visibilitychange'].forEach(function(event) {
document.addEventListener(event, function(event) {
worker.postMessage({ target: 'document', event: cloneEvent(event) });
+ event.preventDefault();
});
});
@@ -66,6 +67,7 @@ function cloneEvent(event) {
['mousedown', 'mouseup', 'mousemove', 'DOMMouseScroll', 'mousewheel', 'mouseout'].forEach(function(event) {
Module.canvas.addEventListener(event, function(event) {
worker.postMessage({ target: 'canvas', event: cloneEvent(event) });
+ event.preventDefault();
}, true);
});