diff --git a/src/Canvas.js b/src/Canvas.js index 2a7bfe68..37517f1b 100644 --- a/src/Canvas.js +++ b/src/Canvas.js @@ -38,13 +38,6 @@ this.element.style.background = 'transparent'; this.context = this.element.getContext(contextType); this.setSize(width, height); - - this.element.addEventListener('mousedown', function(evt) { - evt.preventDefault(); - }); - this.element.addEventListener('touchstart', function(evt) { - evt.preventDefault(); - }); }, /** * get canvas element diff --git a/src/Stage.js b/src/Stage.js index da15c072..330e7cde 100644 --- a/src/Stage.js +++ b/src/Stage.js @@ -23,6 +23,7 @@ INLINE_BLOCK = 'inline-block', KINETICJS_CONTENT = 'kineticjs-content', SPACE = ' ', + UNDERSCORE = '_', CONTAINER = 'container', EVENTS = [MOUSEDOWN, MOUSEMOVE, MOUSEUP, MOUSEOUT, TOUCHSTART, TOUCHMOVE, TOUCHEND], @@ -31,7 +32,8 @@ function addEvent(ctx, eventName) { ctx.content.addEventListener(eventName, function(evt) { - ctx['_' + eventName](evt); + evt.preventDefault(); + ctx[UNDERSCORE + eventName](evt); }, false); } @@ -451,8 +453,6 @@ obj = this.getIntersection(this.getPointerPosition()), shape; - evt.preventDefault(); - if(obj && obj.shape) { shape = obj.shape; this.tapStart = true; @@ -504,8 +504,6 @@ obj = this.getIntersection(this.getPointerPosition()), shape; - evt.preventDefault(); - if(obj && obj.shape) { shape = obj.shape; shape._fireAndBubble(TOUCHMOVE, evt); diff --git a/tests/html/manualTests.html b/tests/html/manualTests.html index d6cdbabf..3877a883 100644 --- a/tests/html/manualTests.html +++ b/tests/html/manualTests.html @@ -16,5 +16,5 @@ }; - + \ No newline at end of file